mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
v0.0.13 #4 - 修复和丰富 ICodeFirst.ConfigEntity 方法;
- 增加 FreeSql.Extensions.EFCoreModelBuilder 扩展库,现实与 EFCore 实体共存; - 增加 FreeSql.RESTful.Demo 示例项目;
This commit is contained in:
@ -6,16 +6,24 @@ namespace FreeSql.Tests.DataAnnotations {
|
||||
[Fact]
|
||||
public void Fluent() {
|
||||
g.mysql.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<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(typeof(TestFluenttb1), a => {
|
||||
a.Name("xxdkdkdk1222").SelectFilter("a.Id22 > 1");
|
||||
a.Property("Id").Name("Id22dd").IsIdentity(true);
|
||||
a.Property("Name").DbType("varchar(101)").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);
|
||||
});
|
||||
})
|
||||
;
|
||||
|
||||
var ddl1 = g.mysql.CodeFirst.GetComparisonDDLStatements<TestFluenttb1>();
|
||||
var ddl2 = g.mysql.CodeFirst.GetComparisonDDLStatements<TestFluenttb2>();
|
||||
|
Reference in New Issue
Block a user