Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
16fbc6654e
  1. 2
      SqlServerTest/Demos/Query.cs
  2. 24
      SqlServerTest/Program.cs
  3. 2
      SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs

2
SqlServerTest/Demos/Query.cs

@ -120,7 +120,7 @@ namespace OrmTest.Demo
var db = GetInstance();
var getAll = db.Queryable<Student>().ToList();
var getId = db.Queryable<Student>().Select(it => it.Id).ToList();
// var getIdIIF= db.Queryable<Student>().Select(it =>new { id = SqlFunc.IIF(it.Id == 0, 1, it.Id) }).ToList();
var getIdIIF= db.Queryable<Student>().Select(it =>new { id = SqlFunc.IIF(it.Id == 0, 1, it.Id),it.Name,it.SchoolId }).ToList();
var getAllNoLock = db.Queryable<Student>().With(SqlWith.NoLock).ToList();
var getByPrimaryKey = db.Queryable<Student>().InSingle(2);
var getSingleOrDefault = db.Queryable<Student>().Single();

24
SqlServerTest/Program.cs

@ -18,18 +18,18 @@ namespace OrmTest
static void Main(string[] args)
{
/***Unit Test***/
new Field(1).Init();
new Where(1).Init();
new Method(1).Init();
new JoinQuery(1).Init();
new SingleQuery(1).Init();
new SelectQuery(1).Init();
new AutoClose(1).Init();
new Insert(1).Init();
new Delete(1).Init();
new Update(1).Init();
new Mapping(1).Init();
new DataTest(1).Init();
//new Field(1).Init();
//new Where(1).Init();
//new Method(1).Init();
//new JoinQuery(1).Init();
//new SingleQuery(1).Init();
//new SelectQuery(1).Init();
//new AutoClose(1).Init();
//new Insert(1).Init();
//new Delete(1).Init();
//new Update(1).Init();
//new Mapping(1).Init();
//new DataTest(1).Init();
/***Performance Test***/
new SqlSugarPerformance(100).Select();

2
SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs

@ -185,7 +185,7 @@ namespace SqlSugar
protected MethodCallExpressionArgs GetMethodCallArgs(ExpressionParameter parameter, Expression item)
{
var newContext = this.Context.GetCopyContext();
newContext.Resolve(item, this.Context.ResolveType);
newContext.Resolve(item, this.Context.IsJoin?ResolveExpressType.WhereMultiple:ResolveExpressType.WhereSingle);
this.Context.Index = newContext.Index;
this.Context.ParameterIndex = newContext.ParameterIndex;
if (newContext.Parameters.IsValuable())

Loading…
Cancel
Save