Exemple #1
0
        public GeneralResponse DeleteAgency(IEnumerable <DeleteRequest> requests)
        {
            GeneralResponse response = new GeneralResponse();

            foreach (var request in requests)
            {
                try
                {
                    _agencyRepository.RemoveById(request.ID);
                }
                catch (Exception ex)
                {
                    response.ErrorMessages.Add(ex.Message);
                    return(response);
                }
            }

            try
            {
                _uow.Commit();
            }
            catch (Exception ex)
            {
                response.ErrorMessages.Add(ex.Message);
            }

            return(response);
        }