Update Core

This commit is contained in:
sunkaixuan
2017-07-01 13:37:56 +08:00
parent 3201a3b290
commit 142100e488
6 changed files with 14 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ namespace SqlSugar
}
public virtual void InitTables(string entitiesNamespace)
{
var types =ReflectionExtensions.LoadAssembly(entitiesNamespace).GetTypes();
var types = ReflectionCore.Load(entitiesNamespace).GetTypes();
InitTables(types);
}
public virtual void InitTables(params string[] entitiesNamespaces)

View File

@@ -795,14 +795,14 @@ namespace SqlSugar
return this;
}
public ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression)
public ISugarQueryable<T, T2, T3> WhereIF(bool isWhere,Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
public ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
@@ -1278,7 +1278,7 @@ namespace SqlSugar
return this;
}
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);

View File

@@ -114,10 +114,6 @@ namespace SqlSugar
}
}
var stringValue = SerializeObject(result);
if (stringValue.IsValuable())
{
stringValue = stringValue.Replace(":{}", ":null");
}
reval.Add((T)DeserializeObject<T>(stringValue));
}
reader.Close();

View File

@@ -8,7 +8,7 @@ namespace SqlSugar
{
public class InstanceFactory
{
static Assembly assembly = ReflectionExtensions.LoadAssembly(PubConst.AssemblyName);
static Assembly assembly = ReflectionCore.Load(PubConst.AssemblyName);
static Dictionary<string, Type> typeCache = new Dictionary<string, Type>();
#region Queryable

View File

@@ -15,7 +15,7 @@ namespace SqlSugar
ISugarQueryable<T> AS<T2>(string tableName);
ISugarQueryable<T> AS(string tableName);
ISugarQueryable<T> With(string withString);
ISugarQueryable<T> Filter(string FilterName, bool isDisabledGobalFilter = false);
ISugarQueryable<T> Filter(string FilterName, bool isDisabledGobalFilter= false);
ISugarQueryable<T> AddParameters(object pars);
ISugarQueryable<T> AddParameters(SugarParameter[] pars);
ISugarQueryable<T> AddJoinInfo(string tableName, string shortName, string joinWhere, JoinType type = JoinType.Left);
@@ -57,7 +57,7 @@ namespace SqlSugar
bool Any(Expression<Func<T, bool>> expression);
bool Any();
ISugarQueryable<TResult> Select<TResult>(Expression<Func<T, TResult>> expression);
ISugarQueryable<TResult> Select<TResult>(string select) where TResult : class, new();
ISugarQueryable<T> Select(string select);
@@ -97,7 +97,7 @@ namespace SqlSugar
new ISugarQueryable<T, T2> Where(Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2> Where(Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
new ISugarQueryable<T, T2> WhereIF(bool isWhere,Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
#endregion
@@ -122,7 +122,7 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
new ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
#endregion
@@ -188,7 +188,7 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4, T5> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
new ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIF(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);
@@ -228,7 +228,7 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
new ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIF(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);

View File

@@ -6,11 +6,11 @@ using System.Threading.Tasks;
namespace SqlSugar
{
public class ReflectionExtensions
public static class ReflectionCore
{
public static Assembly LoadAssembly(string name)
public static Assembly Load(string name)
{
return Assembly.Load(new AssemblyName(PubConst.AssemblyName)) ;
return Assembly.Load(new AssemblyName(PubConst.AssemblyName));
}
}
}