Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
e8997a1d92
  1. 2
      SqlServerTest/UnitTest/Query/JoinQuery.cs
  2. 6
      SqlSugar/SqlSugarAccessory.cs

2
SqlServerTest/UnitTest/Query/JoinQuery.cs

@ -36,7 +36,7 @@ namespace OrmTest.UnitTest
.Where("st.id>@id")
.AddParameters(new { id = 1 })
.Select("st.*").ToSql();
string sql = @"SELECT st.* FROM [STudent] st Left JOIN School sh ON sh.id=st.schoolid WHERE st.id>@id ";
string sql = @"SELECT st.* FROM [Student] st Left JOIN School sh ON sh.id=st.schoolid WHERE st.id>@id ";
base.Check(sql,new List<SugarParameter>() {new SugarParameter("@id",1)}, join3.Key, join3.Value, "join 3 Error");
}
}

6
SqlSugar/SqlSugarAccessory.cs

@ -70,18 +70,18 @@ namespace SqlSugar
protected void InitMppingInfo<T>()
{
string cacheKey = "Context.InitAttributeMappingTables"+typeof(T).FullName;
CacheFactory.Action<EntityInfo>(cacheKey,
var entityInfo=CacheFactory.Func<EntityInfo>(cacheKey,
(cm, key) =>
{
var cacheInfo = cm[key];
InitMppingInfo(cacheInfo);
return cacheInfo;
},
(cm, key) =>
{
var reval = this.Context.EntityProvider.GetEntityInfo<T>();
InitMppingInfo(reval);
return reval;
});
InitMppingInfo(entityInfo);
}
private void InitMppingInfo(EntityInfo entityInfo)
{

Loading…
Cancel
Save