mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update mapper
This commit is contained in:
parent
a6dd3c7f74
commit
9dce130127
@ -245,24 +245,24 @@ namespace OrmTest
|
||||
UserType = 1
|
||||
};
|
||||
db.Insertable(data).ExecuteCommand();
|
||||
var role = new SqlSugarDemo.RoleEntity()
|
||||
{
|
||||
RoleId=Guid.NewGuid(),
|
||||
ManageAccount= Guid.NewGuid(),
|
||||
ManageOrg=Guid.NewGuid(),
|
||||
OrganizationId=Guid.NewGuid(),
|
||||
UnitPrice=1,
|
||||
Quantity=1,
|
||||
RoleName="",
|
||||
RoleType=1,
|
||||
SortNum=1
|
||||
};
|
||||
db.Insertable(role).ExecuteCommand();
|
||||
db.Insertable(new SqlSugarDemo.UserRoleEntity()
|
||||
{
|
||||
RoleId= role.RoleId,
|
||||
UserId=data.UserId
|
||||
}).ExecuteCommand();
|
||||
//var role = new SqlSugarDemo.RoleEntity()
|
||||
//{
|
||||
// RoleId=Guid.NewGuid(),
|
||||
// ManageAccount= Guid.NewGuid(),
|
||||
// ManageOrg=Guid.NewGuid(),
|
||||
// OrganizationId=Guid.NewGuid(),
|
||||
// UnitPrice=1,
|
||||
// Quantity=1,
|
||||
// RoleName="",
|
||||
// RoleType=1,
|
||||
// SortNum=1
|
||||
//};
|
||||
//db.Insertable(role).ExecuteCommand();
|
||||
//db.Insertable(new SqlSugarDemo.UserRoleEntity()
|
||||
//{
|
||||
// RoleId= role.RoleId,
|
||||
// UserId=data.UserId
|
||||
//}).ExecuteCommand();
|
||||
var d111111111111 = db.Queryable<SqlSugarDemo.UserEntity>()
|
||||
.Mapper<SqlSugarDemo.UserEntity, SqlSugarDemo.RoleEntity, SqlSugarDemo.UserRoleEntity>(it => ManyToMany.Config(it.UserId, it.RoleId)).InSingle(data.UserId);
|
||||
}
|
||||
|
@ -243,7 +243,11 @@ namespace SqlSugar
|
||||
FieldValue=string.Join(",",mappingList.Select(z=>UtilMethods.GetPropertyValue(z,m_bPropertyName)).Distinct())
|
||||
}
|
||||
};
|
||||
var bList = this.Context.Queryable<BType>().Where(cons).ToList();
|
||||
List<BType> bList = new List<BType>();
|
||||
if (mappingList.Any())
|
||||
{
|
||||
bList=this.Context.Queryable<BType>().Where(cons).ToList();
|
||||
}
|
||||
|
||||
//get result
|
||||
Dictionary<object, List<BType>> result = new Dictionary<object, List<BType>>();
|
||||
|
Loading…
Reference in New Issue
Block a user