mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 13:03:43 +08:00
Add unit test
This commit is contained in:
@@ -84,7 +84,10 @@ namespace OrmTest
|
||||
}
|
||||
}
|
||||
}).ExecuteCommand();
|
||||
|
||||
db.Aop.OnLogExecuted = (sq, p) =>
|
||||
{
|
||||
Console.WriteLine(sq);
|
||||
};
|
||||
var list=db.Queryable<Country111>()
|
||||
.Includes(x => x.Provinces.OrderByDescending(x111=>x111.Id).ToList())
|
||||
.ToList();
|
||||
@@ -99,30 +102,33 @@ namespace OrmTest
|
||||
.ToList();
|
||||
}
|
||||
|
||||
[SugarTable("Country_111")]
|
||||
public class Country111
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "cid")]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
[Navigat(NavigatType.OneToMany,nameof(Province111.CountryId))]
|
||||
public List<Province111> Provinces { get; set; }
|
||||
}
|
||||
|
||||
[SugarTable("Province_111")]
|
||||
public class Province111
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "pid")]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(ColumnName = "coid")]
|
||||
public int CountryId { get; set; }
|
||||
[Navigat(NavigatType.OneToMany, nameof(City111.ProvinceId))]
|
||||
public List<City111> citys { get; set; }
|
||||
}
|
||||
|
||||
[SugarTable("City_111")]
|
||||
public class City111
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "cid")]
|
||||
public int Id { get; set; }
|
||||
[SugarColumn(ColumnName="ppid")]
|
||||
public int ProvinceId { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
@@ -238,7 +238,7 @@ namespace SqlSugar
|
||||
conditionalModels.Add((new ConditionalModel()
|
||||
{
|
||||
ConditionalType = ConditionalType.In,
|
||||
FieldName = navObjectNameColumnInfo.Navigat.Name,
|
||||
FieldName = navColumn.DbColumnName,
|
||||
FieldValue = String.Join(",", ids),
|
||||
CSharpTypeName = listItemPkColumn.PropertyInfo.PropertyType.Name
|
||||
}));
|
||||
|
Reference in New Issue
Block a user