public IList <Dalyan.Entities.Models.CommonUserType> Handler(CommonUserTypeGetAllQuery query) { try { var result = _db.CommonUserType.Where(x => x.IsDeleted == false).AsEnumerable().ToList(); Mapper.CreateMap <Dalyan.Db.CommonUserType, Dalyan.Entities.Models.CommonUserType>(); return(Mapper.Map <IEnumerable <Dalyan.Db.CommonUserType>, IEnumerable <Dalyan.Entities.Models.CommonUserType> >(result).ToList()); } catch (Exception ex) { throw new ExceptionLog(LogType.DATABASE_SELECT, LogLevel.ERROR, ex, "GetAllQueryHandler"); } }
public ServiceResult <IList <CommonUserType> > GetAll() { try { IMediator service = _container.GetInstance <IMediator>(); var query = new CommonUserTypeGetAllQuery(); return(new ServiceResult <IList <CommonUserType> >(service.Proccess(query), message: ClientErrorMessage.Success(), state: ServiceResultStates.SUCCESS)); } catch (ExceptionLog ex) { LoggerService.Logger.Log(_container, ex); return(new ServiceResult <IList <CommonUserType> >(result: null, message: ClientErrorMessage.Error(), state: ServiceResultStates.ERROR)); } }
public ServiceResult<IList<CommonUserType>> GetAll() { try { IMediator service = _container.GetInstance<IMediator>(); var query = new CommonUserTypeGetAllQuery(); return new ServiceResult<IList<CommonUserType>>(service.Proccess(query), message: ClientErrorMessage.Success(), state: ServiceResultStates.SUCCESS); } catch(ExceptionLog ex) { LoggerService.Logger.Log(_container, ex); return new ServiceResult<IList<CommonUserType>>(result: null, message: ClientErrorMessage.Error(), state: ServiceResultStates.ERROR); } }