コード例 #1
0
 internal static UserRoleWithPermissionsEntity ToEntity(this UserRoleFullInfoModel model, int?id = null) => new UserRoleWithPermissionsEntity
 {
     Id          = id ?? model.Id,
     Name        = model.Name,
     Permissions = model.Permissions.Select(item => new UserRolePermissionEntity
     {
         PermissionGroupId = item.PermissionGroupId,
         Permissions       = item.Permissions.Sum()
     })
 };
コード例 #2
0
 public async Task <ActionResult> AddUserRole([FromBody] UserRoleFullInfoModel model)
 {
     return(await Execute(async operation => await userRoleService.AddUserRole(operation, model.ToEntity())));
 }
コード例 #3
0
 public async Task <ActionResult> UpdateUserRole(int id, [FromBody] UserRoleFullInfoModel model)
 {
     return(await Execute(async operation => await userRoleService.UpdateUserRole(operation, model.ToEntity(id))));
 }