-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
- What should I do about SQL differences due to differences in RDB?
Please specify RdbKind
in QueryOption
.
- The DbType of the value is not what is expected.
If the method you are adding values to has a dbType
argument, specify the correct DbType there.
This is especially necessary if you want to set the value to null
.
- I want to prevent a specified value from being bound to the parameter.
If the method you are adding a value to has isExpression
argument, set it to true.
-
Mapping fails.
- Do the table name (
[Table]
attribute or class name) match? - If the database has a schema, do the schema names match?
- Do the column name (
[Column]
attribute or property name) match? - Is the property
public
? - Does the property have both
getter
andsetter
? - Make sure that the data type of the database column matches the data type of the mapping class property.
- Does the data size match?
- Does
unsigned
match? - In case of enum, also check the data type of the enum.
- Do you assign the
[KEY]
attribute to the primary key? - Has the
[NotMapped]
attribute been assigned? (If it is attached, it will be excluded from mapping.)
- Do the table name (
-
I want to improve processing speed.
Reuse the DbDataMapper
object.
- I want to investigate what is wrong and why.
Check the CommandText
and DbParameterCollection
properties of the DbCommand
.
In this case, setting the QueryOption
's EnableFormat
property to true
will make the query easier to read.
- I can't get the id when I insert.
The InsertReturnAsync
method can only be used if id is auto increment
.
To insert a Guid
, use the InsertAsync
method.
- I want to use it easily.
Define a class that inherits from DbRepositoryBase
and use it.
See example
- Can it be used with other libraries?
Can be used together.
It does not extend or override the original DbConnection
, DbCommand
or DbDataReader
classes, so it is clean and can be used in conjunction with other libraries.
- Izayoi.Data
- Izayoi.Data.Query
- Izayoi.Data.Repository
- Izayoi.Data.Validation
Examples