-
Notifications
You must be signed in to change notification settings - Fork 882
FluentApi
28810 edited this page Apr 28, 2019
·
18 revisions
fsql.CodeFirst
.ConfigEntity<TestFluenttb1>(a => {
a.Name("xxdkdkdk1").SelectFilter("a.Id22 > 0");
a.Property(b => b.Id).Name("Id22").IsIdentity(true);
a.Property(b => b.name).DbType("varchar(100)").IsNullable(true);
})
.ConfigEntity<TestFluenttb2>(a => {
a.Name("xxdkdkdk2").SelectFilter("a.Idx > 0");
a.Property(b => b.Id).Name("Id22").IsIdentity(true);
a.Property(b => b.name).DbType("varchar(100)").IsNullable(true);
});
最好在程序初始化执行,并且这段配置最好只执行一次,避免性能损耗。
FluentApi 的命名与特性保持一致,有关说明请移步参考:《实体特性说明》
从数据库导入特性 > 实体特性 > FluentApi > Aop