public static List <CallCentarViewModel> ConvertToCallCentarViewModelList(this IEnumerable <CallCentar> callCentars)
        {
            List <CallCentarViewModel> CallCentarViewModels = new List <CallCentarViewModel>();

            foreach (CallCentar CallCentar in callCentars)
            {
                CallCentarViewModels.Add(CallCentar.ConvertToCallCentarViewModel());
            }
            return(CallCentarViewModels);
        }
        public CallCentarResponse Delete(Guid identifier)
        {
            CallCentarResponse response = new CallCentarResponse();

            try
            {
                CallCentar deletedCallCentar = unitOfWork.GetCallCentarRepository().Delete(identifier);

                unitOfWork.Save();

                response.CallCentar = deletedCallCentar.ConvertToCallCentarViewModel();
                response.Success    = true;
            }
            catch (Exception ex)
            {
                response.CallCentar = new CallCentarViewModel();
                response.Success    = false;
                response.Message    = ex.Message;
            }

            return(response);
        }
        public CallCentarResponse Create(CallCentarViewModel re)
        {
            CallCentarResponse response = new CallCentarResponse();

            try
            {
                CallCentar addedCallCentar = unitOfWork.GetCallCentarRepository().Create(re.ConvertToCallCentar());

                unitOfWork.Save();

                response.CallCentar = addedCallCentar.ConvertToCallCentarViewModel();
                response.Success    = true;
            }
            catch (Exception ex)
            {
                response.CallCentar = new CallCentarViewModel();
                response.Success    = false;
                response.Message    = ex.Message;
            }

            return(response);
        }