update navigat query

This commit is contained in:
sunkaixuan
2022-04-11 11:27:58 +08:00
parent 492f9784e8
commit ba63399bdf
3 changed files with 15 additions and 8 deletions

View File

@@ -220,6 +220,12 @@ namespace SqlSugar
EntityColumnInfo column = new EntityColumnInfo();
//var isVirtual = property.GetGetMethod().IsVirtual;
//if (isVirtual) continue;
var navigat=property.GetCustomAttribute(typeof(Navigat));
if (navigat != null)
{
column.IsIgnore = true;
column.Navigat = navigat as Navigat;
}
var sugarColumn = property.GetCustomAttributes(typeof(SugarColumn), true)
.Where(it => it is SugarColumn)
.Select(it => (SugarColumn)it)

View File

@@ -36,5 +36,6 @@ namespace SqlSugar
public string[] UIndexGroupNameList { get; set; }
public bool IsArray { get; set; }
public Type UnderType { get; set; }
public Navigat Navigat { get; set; }
}
}

View File

@@ -206,19 +206,19 @@ namespace SqlSugar
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
public class Navigat: Attribute
{
public string name { get; set; }
public Type mappingType { get; set; }
public string aId { get; set; }
public string bId { get; set; }
public string Name { get; set; }
public Type MappingType { get; set; }
public string MappingAId { get; set; }
public string MappingBId { get; set; }
public Navigat(string name)
{
this.name = name;
this.Name = name;
}
public Navigat(Type abType,string aId,string bId)
{
this.mappingType = mappingType;
this.aId = aId;
this.bId= bId;
this.MappingType = abType;
this.MappingAId = aId;
this.MappingBId = bId;
}
}