Browse Source

Add Demo

pull/40/head
sunkaixuan 1 year ago
parent
commit
9dad12d7db
  1. 14
      Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs

14
Src/Asp.NetCore2/QuestDbTest/Demo/DemoE_CodeFirst.cs

@ -52,9 +52,23 @@ namespace OrmTest
Console.Write(db.Queryable<BoolTest5>().First(it=>it.Id==Id).A);
//db.Updateable<BoolTest4>(new BoolTest4() { dateTime = DateTime.Now,A = false, Id = Id }).ExecuteCommand();
db.Updateable<BoolTest5>( new BoolTest5() { dateTime = DateTime.Now, A = false, Id = Id }).ExecuteCommand();
db.CodeFirst.InitTables<UnitSiafayyy>();
var list=db.Queryable<UnitSiafayyy>().SampleBy(1, SampleByUnit.Minute)
.Select(it=>new {
Id=SqlFunc.AggregateMin(it.Id),
Count=SqlFunc.AggregateCount(it.Id)
})
.ToList();
Console.Write(db.Queryable<BoolTest5>().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)]

Loading…
Cancel
Save