mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
Update mapper
This commit is contained in:
parent
a6dd3c7f74
commit
9dce130127
@ -245,24 +245,24 @@ namespace OrmTest
|
|||||||
UserType = 1
|
UserType = 1
|
||||||
};
|
};
|
||||||
db.Insertable(data).ExecuteCommand();
|
db.Insertable(data).ExecuteCommand();
|
||||||
var role = new SqlSugarDemo.RoleEntity()
|
//var role = new SqlSugarDemo.RoleEntity()
|
||||||
{
|
//{
|
||||||
RoleId=Guid.NewGuid(),
|
// RoleId=Guid.NewGuid(),
|
||||||
ManageAccount= Guid.NewGuid(),
|
// ManageAccount= Guid.NewGuid(),
|
||||||
ManageOrg=Guid.NewGuid(),
|
// ManageOrg=Guid.NewGuid(),
|
||||||
OrganizationId=Guid.NewGuid(),
|
// OrganizationId=Guid.NewGuid(),
|
||||||
UnitPrice=1,
|
// UnitPrice=1,
|
||||||
Quantity=1,
|
// Quantity=1,
|
||||||
RoleName="",
|
// RoleName="",
|
||||||
RoleType=1,
|
// RoleType=1,
|
||||||
SortNum=1
|
// SortNum=1
|
||||||
};
|
//};
|
||||||
db.Insertable(role).ExecuteCommand();
|
//db.Insertable(role).ExecuteCommand();
|
||||||
db.Insertable(new SqlSugarDemo.UserRoleEntity()
|
//db.Insertable(new SqlSugarDemo.UserRoleEntity()
|
||||||
{
|
//{
|
||||||
RoleId= role.RoleId,
|
// RoleId= role.RoleId,
|
||||||
UserId=data.UserId
|
// UserId=data.UserId
|
||||||
}).ExecuteCommand();
|
//}).ExecuteCommand();
|
||||||
var d111111111111 = db.Queryable<SqlSugarDemo.UserEntity>()
|
var d111111111111 = db.Queryable<SqlSugarDemo.UserEntity>()
|
||||||
.Mapper<SqlSugarDemo.UserEntity, SqlSugarDemo.RoleEntity, SqlSugarDemo.UserRoleEntity>(it => ManyToMany.Config(it.UserId, it.RoleId)).InSingle(data.UserId);
|
.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())
|
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
|
//get result
|
||||||
Dictionary<object, List<BType>> result = new Dictionary<object, List<BType>>();
|
Dictionary<object, List<BType>> result = new Dictionary<object, List<BType>>();
|
||||||
|
Loading…
Reference in New Issue
Block a user