diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs index 06b966cef..f6925cd03 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs @@ -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 In(PkType primaryKeyValue) { + if (typeof(PkType).FullName.IsCollectionsList()) + { + var newValues = new List(); + foreach (var item in primaryKeyValue as IEnumerable) + { + newValues.Add(item); + } + return In(newValues); + } + + In(new PkType[] { primaryKeyValue }); return this; } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs index 664013689..cd2bc6605 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs @@ -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); } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs index f825f1ed7..b06cb99b4 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs @@ -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 SqlFuncServices { get; set; } public List> AppendDataReaderTypeMappings { get; set; } + + + public Action EntityService{ get; set; } } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Utilities/ValidateExtensions.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Utilities/ValidateExtensions.cs index 56c670467..df518b73f 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Utilities/ValidateExtensions.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Utilities/ValidateExtensions.cs @@ -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) {