This commit is contained in:
sunkaixuan 2022-09-21 13:47:09 +08:00
parent 7d862c8ae9
commit 2cb7781e72

View File

@ -36,6 +36,8 @@ namespace OrmTest
Console.Write(db.Queryable<GuidTest>().First().A); Console.Write(db.Queryable<GuidTest>().First().A);
db.Updateable<GuidTest>(new GuidTest() { A = Guid.NewGuid(), Id = Id }).ExecuteCommand(); db.Updateable<GuidTest>(new GuidTest() { A = Guid.NewGuid(), Id = Id }).ExecuteCommand();
Console.Write(db.Queryable<GuidTest>().First().A); Console.Write(db.Queryable<GuidTest>().First().A);
db.CodeFirst.InitTables<GuidTest2>();
db.Insertable(new GuidTest2() { }).ExecuteReturnSnowflakeId();
} }
private static void TestBool(SqlSugarClient db) private static void TestBool(SqlSugarClient db)
{ {
@ -48,6 +50,12 @@ namespace OrmTest
Console.Write(db.Queryable<BoolTest>().First().A); Console.Write(db.Queryable<BoolTest>().First().A);
} }
} }
public class GuidTest2
{
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public Guid? A { get; set; }
}
public class GuidTest public class GuidTest
{ {
[SugarColumn(IsPrimaryKey = true)] [SugarColumn(IsPrimaryKey = true)]