public async Task <IActionResult> PostNationalityAsync([FromBody] NationalityWriteResource record) { repo.Create(mapper.Map <NationalityWriteResource, Nationality>(await AttachUserIdToRecord(record))); return(StatusCode(200, new { response = ApiMessages.RecordCreated() })); }
public CreateNationalityResponse CreateNationality(CreateNationalityRequest request) { CreateNationalityResponse response = new CreateNationalityResponse(); try { Nationality nationality = request.ConvertToNationality(); _nationalityRepository.Create(nationality); response.Success = true; } catch (Exception ex) { response.Success = false; response.Message = ex.Message; } return(response); }
public void CreateNationality(Nationality entity) { _nationalityRepository.Create(entity); }