public void InitializeVats() { Task.Run(async() => { var existingVats = await VatCore.GetAllAsync().ConfigureAwait(false); if (existingVats.Data != null && existingVats.Data.Count != 0) { return; } await VatCore.CreateAsync(mValueAddedTaxes).ConfigureAwait(false); }).ConfigureAwait(false).GetAwaiter().GetResult(); }
public async Task <IHttpActionResult> GetAll() { try { var response = await VatCore.GetAllAsync().ConfigureAwait(false); return(Ok(response)); } catch (Exception e) { LogHelper.LogException <VatController>(e); return(Ok(ResponseFactory <IList <ValueAddedTax> > .CreateResponse(false, ResponseCode.Error))); } }