diff --git a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/SplitCodeFirstProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/SplitCodeFirstProvider.cs index 29787a86f..7560cdcd5 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/SplitCodeFirstProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/SplitCodeFirstProvider.cs @@ -18,7 +18,7 @@ namespace SqlSugar public void InitTables(Type type) { - var isSplitEntity = type.GetCustomAttributes() != null; + var isSplitEntity = type.GetCustomAttribute() != null; if (isSplitEntity) { _InitTables(type); diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs index 8c0f100d5..4b28342aa 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/NavigatManager.cs @@ -354,7 +354,7 @@ namespace SqlSugar { //var setValue = navList // .Where(x => navColumn.PropertyInfo.GetValue(x).ObjToString() == listItemPkColumn.PropertyInfo.GetValue(item).ObjToString()).ToList(); - var groupQuery = (from l in list + var groupQuery = (from l in list.Distinct() join n in navList on listItemPkColumn.PropertyInfo.GetValue(l).ObjToString() equals navColumn.PropertyInfo.GetValue(n).ObjToString()