Expression BUG

This commit is contained in:
sunkaixuan 2017-12-05 16:00:01 +08:00
parent ebf36b9c91
commit f72eca09df
4 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,7 @@ namespace OrmTest.Demo
public static void Init()
{
for (int i = 0; i < 1000; i++)
for (int i = 0; i < 10; i++)
{
var db = GetMasterSlaveInstance();
var list = db.Insertable(new Student() { Name="aa" }).ExecuteCommand(); // ConnectionString2 or ConnectionString3

View File

@ -16,7 +16,7 @@ namespace OrmTest.Demo
};
db.Insertable(a).AS("student").ExecuteCommand();
var list = db.Queryable<AttributeTest>().AS("student").Select(it => new AttributeTest() { Aid = it.Aid + 1 }).ToList();
var list = db.Queryable<AttributeTest>().AS("student").Select(it => new AttributeTest() { Aid = it.Aid + 1,CreateTime=DateTime.Now,Name=it.Name }).ToList();
}
public class AttributeTest
@ -25,7 +25,7 @@ namespace OrmTest.Demo
public int Aid { get; set; }
public string Name { get; set; }
[SugarColumn(IsOnlyIgnoreInsert = true)]
public int CreateTime { get; set; }
public DateTime CreateTime { get; set; }
}
}
}

View File

@ -109,7 +109,7 @@ namespace SqlSugar
{
if (!ReaderKeys.Contains(mappInfo.DbColumnName))
{
fileName = ReaderKeys.Single(it => it.Equals(mappInfo.DbColumnName, StringComparison.CurrentCultureIgnoreCase));
fileName = ReaderKeys.First(it => it.Equals(mappInfo.DbColumnName, StringComparison.CurrentCultureIgnoreCase)|| it.Equals(mappInfo.PropertyName, StringComparison.CurrentCultureIgnoreCase));
}
else
{

View File

@ -122,6 +122,10 @@ namespace SqlSugar
ExpressionContext copyContext = (ExpressionContext)Activator.CreateInstance(this.GetType(), true);
copyContext.Index = this.Index;
copyContext.ParameterIndex = this.ParameterIndex;
copyContext.MappingColumns = this.MappingColumns;
copyContext.MappingTables = this.MappingTables;
copyContext.IgnoreComumnList = this.IgnoreComumnList;
copyContext.SqlFuncServices = this.SqlFuncServices;
return copyContext;
}
#endregion