Beispiel #1
0
        public List <SiteLocationModel> GetAllSiteLocations()
        {
            return(LogIfOperationFailed(() =>
            {
                var siteLocationEntity = _unitOfWork.SiteLocationRepository.GetAll;
                var siteModelModelList = new List <SiteLocationModel>();
                // ToDo:Need to implement Automapper
                siteLocationEntity.ToList().ForEach(m => { siteModelModelList.Add(SiteLocationMapper.ConvertEntityToModel(m)); });

                return siteModelModelList;
            }, Resources.ExceptionGetForAllProviders, "Provider"));
        }
Beispiel #2
0
        public SiteLocationModel GetSiteLocation(int id)
        {
            return(LogIfOperationFailed(() =>
            {
                var siteLocationEntity = _unitOfWork.SiteLocationRepository.Find(id);

                //ToDo:Need to implement Automapper

                SiteLocationModel siteLocationModel = SiteLocationMapper.ConvertEntityToModel(siteLocationEntity);

                return siteLocationModel;
            }, Resources.ExceptionGetProvider, id));
        }