From b0bfe04e5cdc1599d488eb4c11441edfc1916050 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 19 Mar 2024 15:15:47 +0800 Subject: [PATCH] Update many to many --- .../Entities/Mapping/SugarMappingAttribute.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Entities/Mapping/SugarMappingAttribute.cs b/Src/Asp.NetCore2/SqlSugar/Entities/Mapping/SugarMappingAttribute.cs index 2e580b091..cb95740ac 100644 --- a/Src/Asp.NetCore2/SqlSugar/Entities/Mapping/SugarMappingAttribute.cs +++ b/Src/Asp.NetCore2/SqlSugar/Entities/Mapping/SugarMappingAttribute.cs @@ -239,8 +239,10 @@ namespace SqlSugar internal string MappingBId { get; set; } internal NavigateType NavigatType { get; set; } internal string WhereSql { get; set; } + internal string AClassId { get; set; } + + internal string BClassId { get; set; } - public string GetName() { return Name; @@ -291,13 +293,22 @@ namespace SqlSugar //Check.ExceptionEasy(navigatType != NavigateType.OneToOne, "Currently, only one-to-one navigation configuration Sql conditions are supported", "目前导航配置Sql条件只支持一对一"); } - public Navigate(Type MappingTableType,string typeAiD,string typeBId) + public Navigate(Type MappingTableType,string typeAId,string typeBId) { this.MappingType = MappingTableType; - this.MappingAId = typeAiD; + this.MappingAId = typeAId; this.MappingBId = typeBId; this.NavigatType = NavigateType.ManyToMany; } + public Navigate(Type MappingTableType, string mappingAId, string mappingBId,string aClassId,string bClassId) + { + this.MappingType = MappingTableType; + this.MappingAId = mappingAId; + this.MappingBId = mappingBId; + this.AClassId = aClassId; + this.BClassId = bClassId; + this.NavigatType = NavigateType.ManyToMany; + } public Navigate(Type MappingTableType, string typeAiD, string typeBId,string mappingSql) { this.MappingType = MappingTableType;