Update Core

This commit is contained in:
sunkaixuan
2018-10-16 09:01:47 +08:00
parent ef63dd3283
commit 56aa9188bb
4 changed files with 20 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -231,6 +232,17 @@ namespace SqlSugar
public IDeleteable<T> In<PkType>(PkType primaryKeyValue)
{
if (typeof(PkType).FullName.IsCollectionsList())
{
var newValues = new List<object>();
foreach (var item in primaryKeyValue as IEnumerable)
{
newValues.Add(item);
}
return In(newValues);
}
In(new PkType[] { primaryKeyValue });
return this;
}

View File

@@ -177,6 +177,9 @@ namespace SqlSugar
if (golbalMappingInfo != null)
column.IsIgnore = true;
}
if (this.Context.CurrentConnectionConfig.ConfigureExternalServices != null && this.Context.CurrentConnectionConfig.ConfigureExternalServices.EntityService != null) {
this.Context.CurrentConnectionConfig.ConfigureExternalServices.EntityService(property, column);
}
result.Columns.Add(column);
}
}

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
@@ -90,5 +91,8 @@ namespace SqlSugar
public List<SqlFuncExternal> SqlFuncServices { get; set; }
public List<KeyValuePair<string, CSharpDataType>> AppendDataReaderTypeMappings { get; set; }
public Action<PropertyInfo, EntityColumnInfo> EntityService{ get; set; }
}
}

View File

@@ -151,7 +151,7 @@ namespace SqlSugar
}
public static bool IsCollectionsList(this string thisValue)
{
return (thisValue + "").StartsWith("System.Collections.Generic.List");
return (thisValue + "").StartsWith("System.Collections.Generic.List")|| (thisValue + "").StartsWith("System.Collections.Generic.IEnumerable");
}
public static bool IsStringArray(this string thisValue)
{