public async Task <GetRoleByIdResponse> Handle(GetRoleByIdRequest request)
 {
     return(new GetRoleByIdResponse()
     {
         Role = RoleApiModel.FromRole(await _dataContext.Roles.FindAsync(request.Id))
     });
 }
Esempio n. 2
0
            public async Task <GetRolesResponse> Handle(GetRolesRequest request)
            {
                var roles = await _dataContext.Roles.ToListAsync();

                return(new GetRolesResponse()
                {
                    Roles = roles.Select(x => RoleApiModel.FromRole(x)).ToList()
                });
            }