using OrmTest.UnitTest.Models; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OrmTest { public class UCustom08 { public static void Init() { var db = NewUnitTest.Db; db.CodeFirst.InitTables(); db.CodeFirst.InitTables(); db.Queryable().Where(new List { new ConditionalModel(){ ConditionalType=ConditionalType.In, FieldName="id", FieldValue="null" } }).ToList(); db.Insertable(new Unitasfa1() { Id = Guid.NewGuid() }).ExecuteCommand(); db.Insertable(new Unitasfa1() { Id = Guid.NewGuid(),ItemId=Guid.NewGuid() }).ExecuteCommand(); var list = db.Queryable().Mapper(x => x.items, x => x.ItemId).ToList(); } public class Unitasfa1 { [SugarColumn(IsPrimaryKey = true)] public Guid Id { get; set; } [SugarColumn(IsNullable = true)] public Guid? ItemId { get; set; } [SugarColumn(IsIgnore = true)] public List items { get; set; } } public class Unitasfa1Item { [SugarColumn(IsPrimaryKey = true)] public Guid Id { get; set; } } } }