public async void Post([FromBody] FileTypeReference fileTypeReference) { using (_codeVortoService = new CodeVortoService()) { await _codeVortoService.FileTypeReferenceRepository.AddNewItem(fileTypeReference); } }
public ActionResult <FileTypeReference> Post([FromBody] FileTypeReference fileTypeReference) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var addedConfig = FileTypeReferenceRepository.AddDocument(fileTypeReference).GetAwaiter().GetResult(); return(Ok(addedConfig)); }
public async Task <ActionResult> AddFileTypeReference([FromBody] FileTypeReference extensionReference) { if (!ModelState.IsValid) { return(BadRequest(ModelState.Values)); } using (var generalService = new GeneralService().BaseRepository <FileTypeReference>()) { var extRef = await generalService.AddDocument(extensionReference).ConfigureAwait(false); return(Ok(extRef)); } }