Support CodeFirst Multiple Primary Key

This commit is contained in:
sunkaixuan
2019-02-10 18:38:24 +08:00
parent f87ece6d84
commit c8f87dc029
8 changed files with 44 additions and 6 deletions

View File

@@ -34,6 +34,15 @@ namespace OrmTest.Demo
[SugarColumn(IsIgnore =true)]
public string TestId { get; set; }
}
public class CodeTable3
{
[SugarColumn(IsPrimaryKey =true)]
public int Id { get; set; }
[SugarColumn(IsPrimaryKey = true)]
public string Name { get; set; }
[SugarColumn(IsIgnore = true)]
public string TestId { get; set; }
}
public class CodeFirst : DemoBase
{
public static void Init()
@@ -51,6 +60,9 @@ namespace OrmTest.Demo
//No backup table
db.CodeFirst.SetStringDefaultLength(10).InitTables(typeof(CodeTable),typeof(CodeTable2));
db.CodeFirst.InitTables(typeof(CodeTable3));
}
}
}