diff --git a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/DeleteNavManyToMany.cs b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/DeleteNavManyToMany.cs index 015fa3e23..6aca998eb 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/DeleteNavManyToMany.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/DeleteNavManyToMany.cs @@ -16,13 +16,13 @@ namespace SqlSugar var parentNavigateProperty = parentEntity.Columns.FirstOrDefault(it => it.PropertyName == name); var thisEntity = this._Context.EntityMaintenance.GetEntityInfo(); var thisPkColumn = thisEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true); - Check.Exception(thisPkColumn == null, $"{thisPkColumn.EntityName} need primary key", $"{thisPkColumn.EntityName}需要主键"); - Check.Exception(parentPkColumn == null, $"{parentPkColumn.EntityName} need primary key", $"{parentPkColumn.EntityName}需要主键"); + Check.ExceptionEasy(thisPkColumn == null, $"{thisPkColumn.EntityName} need primary key", $"{thisPkColumn.EntityName}需要主键"); + Check.ExceptionEasy(parentPkColumn == null, $"{parentPkColumn.EntityName} need primary key", $"{parentPkColumn.EntityName}需要主键"); var mappingType = parentNavigateProperty.Navigat.MappingType; var mappingEntity = this._Context.EntityMaintenance.GetEntityInfo(mappingType); var mappingA = mappingEntity.Columns.FirstOrDefault(x => x.PropertyName == parentNavigateProperty.Navigat.MappingAId); var mappingB = mappingEntity.Columns.FirstOrDefault(x => x.PropertyName == parentNavigateProperty.Navigat.MappingBId); - Check.Exception(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误"); + Check.ExceptionEasy(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误"); var mappingPk = mappingEntity.Columns .Where(it => it.PropertyName != mappingA.PropertyName) .Where(it => it.PropertyName != mappingB.PropertyName) diff --git a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs index d05d57013..a218e3ec7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/InsertNavProviderManyToMany.cs @@ -16,13 +16,13 @@ namespace SqlSugar var parentNavigateProperty = parentEntity.Columns.FirstOrDefault(it => it.PropertyName == name); var thisEntity = this._Context.EntityMaintenance.GetEntityInfo(); var thisPkColumn = thisEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true); - Check.Exception(thisPkColumn == null, $"{thisPkColumn.EntityName} need primary key", $"{thisPkColumn.EntityName}需要主键"); - Check.Exception(parentPkColumn == null, $"{parentPkColumn.EntityName} need primary key", $"{parentPkColumn.EntityName}需要主键"); + Check.ExceptionEasy(thisPkColumn == null, $"{thisPkColumn.EntityName} need primary key", $"{thisPkColumn.EntityName}需要主键"); + Check.ExceptionEasy(parentPkColumn == null, $"{parentPkColumn.EntityName} need primary key", $"{parentPkColumn.EntityName}需要主键"); var mappingType=parentNavigateProperty.Navigat.MappingType; var mappingEntity = this._Context.EntityMaintenance.GetEntityInfo(mappingType); var mappingA = mappingEntity.Columns.FirstOrDefault(x=>x.PropertyName== parentNavigateProperty.Navigat.MappingAId); var mappingB = mappingEntity.Columns.FirstOrDefault(x => x.PropertyName == parentNavigateProperty.Navigat.MappingBId); - Check.Exception(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误"); + Check.ExceptionEasy(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误"); var mappingPk = mappingEntity.Columns .Where(it => it.PropertyName != mappingA.PropertyName) .Where(it => it.PropertyName != mappingB.PropertyName) diff --git a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/UpdateNavManyToMany.cs b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/UpdateNavManyToMany.cs index bf5d04576..49da10015 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/UpdateNavManyToMany.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/ExecuteNavProvider/UpdateNavManyToMany.cs @@ -16,13 +16,13 @@ namespace SqlSugar var parentNavigateProperty = parentEntity.Columns.FirstOrDefault(it => it.PropertyName == name); var thisEntity = this._Context.EntityMaintenance.GetEntityInfo(); var thisPkColumn = thisEntity.Columns.FirstOrDefault(it => it.IsPrimarykey == true); - Check.Exception(thisPkColumn == null, $"{thisPkColumn.EntityName} need primary key", $"{thisPkColumn.EntityName}需要主键"); - Check.Exception(parentPkColumn == null, $"{parentPkColumn.EntityName} need primary key", $"{parentPkColumn.EntityName}需要主键"); + Check.ExceptionEasy(thisPkColumn == null, $"{thisPkColumn.EntityName} need primary key", $"{thisPkColumn.EntityName}需要主键"); + Check.ExceptionEasy(parentPkColumn == null, $"{parentPkColumn.EntityName} need primary key", $"{parentPkColumn.EntityName}需要主键"); var mappingType = parentNavigateProperty.Navigat.MappingType; var mappingEntity = this._Context.EntityMaintenance.GetEntityInfo(mappingType); var mappingA = mappingEntity.Columns.FirstOrDefault(x => x.PropertyName == parentNavigateProperty.Navigat.MappingAId); var mappingB = mappingEntity.Columns.FirstOrDefault(x => x.PropertyName == parentNavigateProperty.Navigat.MappingBId); - Check.Exception(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误"); + Check.ExceptionEasy(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误"); var mappingPk = mappingEntity.Columns .Where(it => it.PropertyName != mappingA.PropertyName) .Where(it => it.PropertyName != mappingB.PropertyName)