Update Demo

This commit is contained in:
sunkaixuan 2019-05-25 07:35:37 +08:00
parent b89c05d2bc
commit fb2eeaf171
3 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,7 @@ namespace OrmTest
var getByWhere = db.Queryable<Order>().Where(it => it.Id == 1 || it.Name == "a").ToList();
var getByWhere2 = db.Queryable<Order>().Where(it => it.Id == DateTime.Now.Year).ToList();
var getByFuns = db.Queryable<Order>().Where(it => SqlFunc.IsNullOrEmpty(it.Name)).ToList();
var getByFuns2 = db.Queryable<Order>().GroupBy(it=>it.Name).Select(it=>SqlFunc.AggregateDistinctCount(it.Price)).ToList();
Console.WriteLine("#### Examples End ####");
}

View File

@ -41,6 +41,7 @@ namespace OrmTest
var getByWhere = db.Queryable<Order>().Where(it => it.Id == 1 || it.Name == "a").ToList();
var getByWhere2 = db.Queryable<Order>().Where(it => it.Id == DateTime.Now.Year).ToList();
var getByFuns = db.Queryable<Order>().Where(it => SqlFunc.IsNullOrEmpty(it.Name)).ToList();
var getByFuns2 = db.Queryable<Order>().GroupBy(it => it.Name).Select(it => SqlFunc.AggregateDistinctCount(it.Price)).ToList();
Console.WriteLine("#### Examples End ####");
}

View File

@ -101,6 +101,7 @@ namespace SqlSugar
public static TResult AggregateMin<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static TResult AggregateMax<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int AggregateCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int AggregateDistinctCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static TResult MappingColumn<TResult>(TResult oldColumnName,string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); }
/// <summary>
///Example: new NewT(){name=SqlFunc.GetSelfAndAutoFill(it)} Generated SQL it.*