Exemple #1
0
        public GetGeneralResponse <IEnumerable <AgencyView> > GetAgencies()
        {
            GetGeneralResponse <IEnumerable <AgencyView> > response = new GetGeneralResponse <IEnumerable <AgencyView> >();

            try
            {
                IList <Sort> sortOrders = new List <Sort>();
                sortOrders.Add(new Sort("SortOrder"));

                Response <Agency> agencies = _agencyRepository.FindAllWithSort(-1, -1, sortOrders);

                response.data       = agencies.data.ConvertToAgencyViews();
                response.totalCount = agencies.totalCount;
            }
            catch (Exception ex)
            {
                response.ErrorMessages.Add(ex.Message);
            }

            return(response);
        }