public async Task <BaseEntity> SaveAndReturnEntityAsync(UserApplicationRoleDto entityDto) { var entity = _mapper.Map <UserApplicationRole>(entityDto); var result = await _repository.SaveAndReturnEntityAsync(entity); return(result); }
public async Task <IActionResult> Put(int id, [FromBody] UserApplicationRoleDto userApplicationRole) { if (id == 0 || userApplicationRole.Id == 0) { return(StatusCode(StatusCodes.Status400BadRequest, "Id needs to be greater than 0.")); } return(await SaveAndReturnEntityAsync(async() => await _userApplicationRoleService.SaveAndReturnEntityAsync(userApplicationRole))); }
public async Task <IActionResult> Post([FromBody] UserApplicationRoleDto userApplicationRole) { if (userApplicationRole.Id != 0) { return(StatusCode(StatusCodes.Status400BadRequest, "Identity insert is not permitted.")); } return(await SaveAndReturnEntityAsync(async() => await _userApplicationRoleService.SaveAndReturnEntityAsync(userApplicationRole))); }
public async Task <int> SaveAsync(UserApplicationRoleDto entityDto) { var result = await SaveAndReturnEntityAsync(entityDto); return(result.Id); }
public async Task<UserApplicationRoleDto> PutUserApplicationRole(int id,UserApplicationRoleDto model) { var url = CRMApiUri + "/UserApplicationRole/"+ id; var result = await PutRequestToApi(url, model); return result; }
public async Task<UserApplicationRoleDto> PostUserApplicationRole(UserApplicationRoleDto model) { var url = CRMApiUri + "/UserApplicationRole"; var result = await PostRequestToApi(url, model); return result; }
public async Task <UserApplicationRoleDto> PutUserApplicationRole(int id, UserApplicationRoleDto model) { return(await _userApplicationRoleApiClient.PutUserApplicationRole(id, model)); }
public async Task <UserApplicationRoleDto> PostUserApplicationRole(UserApplicationRoleDto model) { return(await _userApplicationRoleApiClient.PostUserApplicationRole(model)); }