[ProducesResponseType(StatusCodes.Status500InternalServerError)] // if something unexpectedly went wrong with the database or http request/response public async Task <ActionResult <Furs2Feathers.Domain.Models.Claims> > PostClaims(Furs2Feathers.Domain.Models.Claims claims) { claimsRepo.Add(claims); await claimsRepo.SaveChangesAsync(); return(CreatedAtAction("GetClaims", new { id = claims.ClaimId }, claims)); }
public async Task <BaseResponse> CreateAsync(ClaimsRow claimsRequest) { try { var response = new BaseResponse(); Claims claims = new Entities.Claims(); claimsRequest.CopyPropertiesTo(claims); await _claimsRepository.Add(claims); return(response.ToSuccess <BaseResponse>()); } catch (Exception e) { throw new Exception(e.Message); } }