public async Task UpdateRoleAsync(Guid id, UserRoleEdit dto) { var user = await GetByIdAsync(id); if (user is null) { throw new EntityNotFoundException <ApplicationUser>(); } mapper.Map(dto, user); await UpdateAsync(user); }
public bool UpdateUserRoleData(UserRoleEdit model) { bool result = false; var uri = string.Empty; var sourceModel = new UserRole(); EntityMapper <UserRoleEdit, UserRole> .Map(model, sourceModel); sourceModel.SchoolId = SessionHelper.CurrentSession.SchoolId; if (model.IsAddMode) { uri = API.UserRole.InsertUserRole(_path); } else { uri = API.UserRole.UpdateUserRole(_path); } HttpResponseMessage response = _client.PostAsJsonAsync(uri, sourceModel).Result; return(response.IsSuccessStatusCode); }