mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
rename
This commit is contained in:
parent
6acffac179
commit
73a6804a54
@ -149,9 +149,9 @@ namespace OrmTest
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int ParentId { get; set; }
|
||||
[Navigat(NavigatType.OneToOne,nameof(ParentId))]
|
||||
[Navigate(NavigateType.OneToOne,nameof(ParentId))]
|
||||
public Tree1 Parent { get; set; }
|
||||
[Navigat(NavigatType.OneToMany,nameof(Tree1.ParentId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Tree1.ParentId))]
|
||||
public List<Tree1> Child { get; set; }
|
||||
}
|
||||
public class ABMapping1
|
||||
@ -166,7 +166,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true )]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Navigat(typeof(ABMapping1),nameof(ABMapping1.AId),nameof(ABMapping1.BId))]
|
||||
[Navigate(typeof(ABMapping1),nameof(ABMapping1.AId),nameof(ABMapping1.BId))]
|
||||
public List<B1> BList { get; set; }
|
||||
}
|
||||
public class B1
|
||||
@ -174,7 +174,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true )]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Navigat(typeof(ABMapping1), nameof(ABMapping1.BId), nameof(ABMapping1.AId))]
|
||||
[Navigate(typeof(ABMapping1), nameof(ABMapping1.BId), nameof(ABMapping1.AId))]
|
||||
public List<A1> AList { get; set; }
|
||||
}
|
||||
|
||||
@ -184,9 +184,9 @@ namespace OrmTest
|
||||
public int StudentId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int SchoolId { get; set; }
|
||||
[Navigat(NavigatType.OneToOne, nameof(SchoolId))]
|
||||
[Navigate(NavigateType.OneToOne, nameof(SchoolId))]
|
||||
public SchoolA SchoolA { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(BookA.studenId))]
|
||||
[Navigate(NavigateType.OneToMany, nameof(BookA.studenId))]
|
||||
public List<BookA> Books { get; set; }
|
||||
|
||||
}
|
||||
@ -195,7 +195,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public int SchoolId { get; set; }
|
||||
public string SchoolName { get; set; }
|
||||
[Navigat(NavigatType.OneToMany,nameof(RoomA.SchoolId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(RoomA.SchoolId))]
|
||||
public List<RoomA> RoomList { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<TeacherA> TeacherList { get; set; }
|
||||
|
@ -104,7 +104,7 @@ namespace OrmTest
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province111.CountryId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Province111.CountryId))]
|
||||
public List<Province111> Provinces { get; set; }
|
||||
}
|
||||
[SugarTable("Province_111")]
|
||||
@ -115,7 +115,7 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(ColumnName = "coid")]
|
||||
public int CountryId { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(City111.ProvinceId))]
|
||||
[Navigate(NavigateType.OneToMany, nameof(City111.ProvinceId))]
|
||||
public List<City111> citys { get; set; }
|
||||
}
|
||||
[SugarTable("City_111")]
|
||||
|
@ -68,10 +68,10 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
public int InfoId { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToOne, nameof(InfoId))]
|
||||
[Navigate(NavigateType.OneToOne, nameof(InfoId))]
|
||||
public Country111Info Info { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province1111.CountryId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Province1111.CountryId))]
|
||||
public List<Province1111> Provinces { get; set; }
|
||||
}
|
||||
|
||||
|
@ -149,9 +149,9 @@ namespace OrmTest
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int ParentId { get; set; }
|
||||
[Navigat(NavigatType.OneToOne,nameof(ParentId))]
|
||||
[Navigate(NavigateType.OneToOne,nameof(ParentId))]
|
||||
public Tree1 Parent { get; set; }
|
||||
[Navigat(NavigatType.OneToMany,nameof(Tree1.ParentId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Tree1.ParentId))]
|
||||
public List<Tree1> Child { get; set; }
|
||||
}
|
||||
public class ABMapping1
|
||||
@ -166,7 +166,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true )]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Navigat(typeof(ABMapping1),nameof(ABMapping1.AId),nameof(ABMapping1.BId))]
|
||||
[Navigate(typeof(ABMapping1),nameof(ABMapping1.AId),nameof(ABMapping1.BId))]
|
||||
public List<B1> BList { get; set; }
|
||||
}
|
||||
public class B1
|
||||
@ -174,7 +174,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true )]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Navigat(typeof(ABMapping1), nameof(ABMapping1.BId), nameof(ABMapping1.AId))]
|
||||
[Navigate(typeof(ABMapping1), nameof(ABMapping1.BId), nameof(ABMapping1.AId))]
|
||||
public List<A1> AList { get; set; }
|
||||
}
|
||||
|
||||
@ -184,9 +184,9 @@ namespace OrmTest
|
||||
public int StudentId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int SchoolId { get; set; }
|
||||
[Navigat(NavigatType.OneToOne, nameof(SchoolId))]
|
||||
[Navigate(NavigateType.OneToOne, nameof(SchoolId))]
|
||||
public SchoolA SchoolA { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(BookA.studenId))]
|
||||
[Navigate(NavigateType.OneToMany, nameof(BookA.studenId))]
|
||||
public List<BookA> Books { get; set; }
|
||||
|
||||
}
|
||||
@ -195,7 +195,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public int SchoolId { get; set; }
|
||||
public string SchoolName { get; set; }
|
||||
[Navigat(NavigatType.OneToMany,nameof(RoomA.SchoolId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(RoomA.SchoolId))]
|
||||
public List<RoomA> RoomList { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<TeacherA> TeacherList { get; set; }
|
||||
|
@ -104,7 +104,7 @@ namespace OrmTest
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province111.CountryId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Province111.CountryId))]
|
||||
public List<Province111> Provinces { get; set; }
|
||||
}
|
||||
[SugarTable("Province_111")]
|
||||
@ -115,7 +115,7 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(ColumnName = "coid")]
|
||||
public int CountryId { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(City111.ProvinceId))]
|
||||
[Navigate(NavigateType.OneToMany, nameof(City111.ProvinceId))]
|
||||
public List<City111> citys { get; set; }
|
||||
}
|
||||
[SugarTable("City_111")]
|
||||
|
@ -68,10 +68,10 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
public int InfoId { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToOne, nameof(InfoId))]
|
||||
[Navigate(NavigateType.OneToOne, nameof(InfoId))]
|
||||
public Country111Info Info { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province1111.CountryId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Province1111.CountryId))]
|
||||
public List<Province1111> Provinces { get; set; }
|
||||
}
|
||||
|
||||
|
@ -149,9 +149,9 @@ namespace OrmTest
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int ParentId { get; set; }
|
||||
[Navigat(NavigatType.OneToOne,nameof(ParentId))]
|
||||
[Navigate(NavigateType.OneToOne,nameof(ParentId))]
|
||||
public Tree1 Parent { get; set; }
|
||||
[Navigat(NavigatType.OneToMany,nameof(Tree1.ParentId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Tree1.ParentId))]
|
||||
public List<Tree1> Child { get; set; }
|
||||
}
|
||||
public class ABMapping1
|
||||
@ -166,7 +166,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true )]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Navigat(typeof(ABMapping1),nameof(ABMapping1.AId),nameof(ABMapping1.BId))]
|
||||
[Navigate(typeof(ABMapping1),nameof(ABMapping1.AId),nameof(ABMapping1.BId))]
|
||||
public List<B1> BList { get; set; }
|
||||
}
|
||||
public class B1
|
||||
@ -174,7 +174,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true )]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Navigat(typeof(ABMapping1), nameof(ABMapping1.BId), nameof(ABMapping1.AId))]
|
||||
[Navigate(typeof(ABMapping1), nameof(ABMapping1.BId), nameof(ABMapping1.AId))]
|
||||
public List<A1> AList { get; set; }
|
||||
}
|
||||
|
||||
@ -184,9 +184,9 @@ namespace OrmTest
|
||||
public int StudentId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int SchoolId { get; set; }
|
||||
[Navigat(NavigatType.OneToOne, nameof(SchoolId))]
|
||||
[Navigate(NavigateType.OneToOne, nameof(SchoolId))]
|
||||
public SchoolA SchoolA { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(BookA.studenId))]
|
||||
[Navigate(NavigateType.OneToMany, nameof(BookA.studenId))]
|
||||
public List<BookA> Books { get; set; }
|
||||
|
||||
}
|
||||
@ -195,7 +195,7 @@ namespace OrmTest
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public int SchoolId { get; set; }
|
||||
public string SchoolName { get; set; }
|
||||
[Navigat(NavigatType.OneToMany,nameof(RoomA.SchoolId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(RoomA.SchoolId))]
|
||||
public List<RoomA> RoomList { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<TeacherA> TeacherList { get; set; }
|
||||
|
@ -109,7 +109,7 @@ namespace OrmTest
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province111.CountryId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Province111.CountryId))]
|
||||
public List<Province111> Provinces { get; set; }
|
||||
}
|
||||
[SugarTable("Province_111")]
|
||||
@ -120,7 +120,7 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(ColumnName = "coid")]
|
||||
public int CountryId { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(City111.ProvinceId))]
|
||||
[Navigate(NavigateType.OneToMany, nameof(City111.ProvinceId))]
|
||||
public List<City111> citys { get; set; }
|
||||
}
|
||||
[SugarTable("City_111")]
|
||||
|
@ -73,10 +73,10 @@ namespace OrmTest
|
||||
public string Name { get; set; }
|
||||
public int InfoId { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToOne, nameof(InfoId))]
|
||||
[Navigate(NavigateType.OneToOne, nameof(InfoId))]
|
||||
public Country111Info Info { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province1111.CountryId))]
|
||||
[Navigate(NavigateType.OneToMany,nameof(Province1111.CountryId))]
|
||||
public List<Province1111> Provinces { get; set; }
|
||||
}
|
||||
|
||||
|
@ -220,11 +220,11 @@ namespace SqlSugar
|
||||
EntityColumnInfo column = new EntityColumnInfo();
|
||||
//var isVirtual = property.GetGetMethod().IsVirtual;
|
||||
//if (isVirtual) continue;
|
||||
var navigat=property.GetCustomAttribute(typeof(Navigat));
|
||||
var navigat=property.GetCustomAttribute(typeof(Navigate));
|
||||
if (navigat != null)
|
||||
{
|
||||
column.IsIgnore = true;
|
||||
column.Navigat = navigat as Navigat;
|
||||
column.Navigat = navigat as Navigate;
|
||||
}
|
||||
var sugarColumn = property.GetCustomAttributes(typeof(SugarColumn), true)
|
||||
.Where(it => it is SugarColumn)
|
||||
|
@ -114,15 +114,15 @@ namespace SqlSugar
|
||||
|
||||
|
||||
|
||||
if (navObjectNameColumnInfo.Navigat.NavigatType == NavigatType.OneToOne)
|
||||
if (navObjectNameColumnInfo.Navigat.NavigatType == NavigateType.OneToOne)
|
||||
{
|
||||
OneToOne(list, selector, listItemEntity, navObjectNamePropety, navObjectNameColumnInfo);
|
||||
}
|
||||
else if (navObjectNameColumnInfo.Navigat.NavigatType == NavigatType.OneToMany)
|
||||
else if (navObjectNameColumnInfo.Navigat.NavigatType == NavigateType.OneToMany)
|
||||
{
|
||||
OneToMany(list, selector, listItemEntity, navObjectNamePropety, navObjectNameColumnInfo);
|
||||
}
|
||||
else if (navObjectNameColumnInfo.Navigat.NavigatType == NavigatType.ManyToOne)
|
||||
else if (navObjectNameColumnInfo.Navigat.NavigatType == NavigateType.ManyToOne)
|
||||
{
|
||||
OneToOne(list, selector, listItemEntity, navObjectNamePropety, navObjectNameColumnInfo);
|
||||
}
|
||||
|
@ -36,6 +36,6 @@ namespace SqlSugar
|
||||
public string[] UIndexGroupNameList { get; set; }
|
||||
public bool IsArray { get; set; }
|
||||
public Type UnderType { get; set; }
|
||||
public Navigat Navigat { get; set; }
|
||||
public Navigate Navigat { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -204,24 +204,24 @@ namespace SqlSugar
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property, Inherited = true)]
|
||||
public class Navigat: Attribute
|
||||
public class Navigate: Attribute
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Type MappingType { get; set; }
|
||||
public string MappingAId { get; set; }
|
||||
public string MappingBId { get; set; }
|
||||
public NavigatType NavigatType { get; set; }
|
||||
public Navigat(NavigatType navigatType,string name)
|
||||
public NavigateType NavigatType { get; set; }
|
||||
public Navigate(NavigateType navigatType,string name)
|
||||
{
|
||||
this.Name = name;
|
||||
this.NavigatType = navigatType;
|
||||
}
|
||||
public Navigat(Type MappingTableType,string typeAiD,string typeBId)
|
||||
public Navigate(Type MappingTableType,string typeAiD,string typeBId)
|
||||
{
|
||||
this.MappingType = MappingTableType;
|
||||
this.MappingAId = typeAiD;
|
||||
this.MappingBId = typeBId;
|
||||
this.NavigatType = NavigatType.ManyToMany;
|
||||
this.NavigatType = NavigateType.ManyToMany;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public enum NavigatType
|
||||
public enum NavigateType
|
||||
{
|
||||
OneToOne=1,
|
||||
OneToMany=2,
|
||||
|
@ -12,7 +12,7 @@ namespace SqlSugar
|
||||
private SqlSugarProvider context;
|
||||
private EntityInfo EntityInfo;
|
||||
private EntityInfo ProPertyEntity;
|
||||
private Navigat Navigat;
|
||||
private Navigate Navigat;
|
||||
public string ShorName;
|
||||
private string MemberName;
|
||||
public OneToOneNavgateExpression(SqlSugarProvider context)
|
||||
|
@ -12,7 +12,7 @@ namespace SqlSugar
|
||||
private SqlSugarProvider context;
|
||||
private EntityInfo EntityInfo;
|
||||
private EntityInfo ProPertyEntity;
|
||||
private Navigat Navigat;
|
||||
private Navigate Navigat;
|
||||
public string ShorName;
|
||||
private string MemberName;
|
||||
private string MethodName;
|
||||
@ -82,7 +82,7 @@ namespace SqlSugar
|
||||
}
|
||||
internal MapperSql GetSql()
|
||||
{
|
||||
if (Navigat.NavigatType == NavigatType.OneToMany)
|
||||
if (Navigat.NavigatType == NavigateType.OneToMany)
|
||||
{
|
||||
return GetOneToManySql();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user