mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-27 11:19:15 +08:00
Support CodeFirst Multiple Primary Key
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user