2022-0302

如果你Oracle数据库的字段类型varchar2,你C#的model类使用string则默认会命不中索引,造成执行性能慢问题


EFCore解决方案:

因为EF访问Oracle默认支持Unicode数据类型,默认将string映射为nvarchar2,如果数据库类型不是nvarchar2则无法命中索引。

重写context的OnModelCreating,将默认string映射修改为varchar2,即不支持Unicode类型即可

protected 阅读全文>>
                
标签: EFCore Unicode SetIsUnicode 阅读:12235
2021-0915

EF中默认的decimal数据精度为两位数,当我们数据库设置的精度大于2时,EF将只会保留到2为精度。


可使用如下方法将其修改为4位精度:


EF

protectedoverridevoidOnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Properties<decimal>().Configure(config => config.HasPrecision(18, 4));
}


EF CO 阅读全文>>

标签: EF decimal 精度 阅读:12298
2013-1125

xml中的textView:

<TextView
        android:id="@+id/bookTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:drawableLeft="@drawable/checkmark"
        android:gravity="center_vertical"
        android:textStyle="bold"
        android:textSize="24dip" 阅读全文>>
                
标签: Android TextView DrawableLeft 阅读:9721