public static List <VatViewModel> ConvertToVatViewModelList(this IEnumerable <Vat> Vats)
        {
            List <VatViewModel> VatViewModels = new List <VatViewModel>();

            foreach (Vat Vat in Vats)
            {
                VatViewModels.Add(Vat.ConvertToVatViewModel());
            }
            return(VatViewModels);
        }
        public VatResponse Delete(Guid identifier)
        {
            VatResponse response = new VatResponse();

            try
            {
                Vat deletedVat = unitOfWork.GetVatRepository().Delete(identifier);

                unitOfWork.Save();

                response.Vat     = deletedVat.ConvertToVatViewModel();
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Vat     = new VatViewModel();
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        public VatResponse Create(VatViewModel re)
        {
            VatResponse response = new VatResponse();

            try
            {
                Vat addedVat = unitOfWork.GetVatRepository().Create(re.ConvertToVat());

                unitOfWork.Save();

                response.Vat     = addedVat.ConvertToVatViewModel();
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Vat     = new VatViewModel();
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }