mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 04:27:14 +08:00
Update Demo
This commit is contained in:
@@ -12,7 +12,7 @@ namespace OrmTest.Demo
|
||||
public static void Init()
|
||||
{
|
||||
var db = GetInstance();
|
||||
|
||||
db.CurrentConnectionConfig.InitKeyType = SqlSugar.InitKeyType.Attribute;
|
||||
|
||||
//create tables
|
||||
db.CodeFirst.SetStringDefaultLength(100).InitTables(typeof(MyOrder),typeof(OrderItem),typeof(Person));
|
||||
@@ -40,6 +40,7 @@ namespace OrmTest.Demo
|
||||
.Mapper(it => it.masterPerson, it => it.masterPersonId)
|
||||
.Mapper(it => it.Persons, it => it.orgId)
|
||||
.Mapper(it => it.OrderItems, it => it.OrderItems.First().masterOrderId)
|
||||
.Mapper(it => it.OrderItemSignle, it => it.OrderItemSignle.masterOrderId)
|
||||
.Mapper(it => {
|
||||
it.orderName = it.orderName + "aa";//
|
||||
})
|
||||
@@ -56,6 +57,8 @@ namespace OrmTest.Demo
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public List<OrderItem> OrderItems { get; set; }
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public OrderItem OrderItemSignle { get; set; }
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public List<Person> Persons { get; set; }
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public Person masterPerson { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user