diff --git a/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs index bd7e79fbe..2a69154a9 100644 --- a/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs @@ -52,9 +52,23 @@ namespace OrmTest Console.Write(db.Queryable().First(it=>it.Id==Id).A); //db.Updateable(new BoolTest4() { dateTime = DateTime.Now,A = false, Id = Id }).ExecuteCommand(); db.Updateable( new BoolTest5() { dateTime = DateTime.Now, A = false, Id = Id }).ExecuteCommand(); + db.CodeFirst.InitTables(); + var list=db.Queryable().SampleBy(1, SampleByUnit.Minute) + .Select(it=>new { + Id=SqlFunc.AggregateMin(it.Id), + Count=SqlFunc.AggregateCount(it.Id) + }) + .ToList(); Console.Write(db.Queryable().First(it => it.Id == Id).A); } } + public class UnitSiafayyy + { + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + [TimeDbSplitField(DateType.Day)] + public DateTime DateTime { get; set; } + } public class GuidTest { [SugarColumn(IsPrimaryKey = true)]