Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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)));
            }
        }