public Task <PagedResult <WareHouseDto> > GetPaged(string name, string orderBy = "", bool orderAsc = true, int page = 1, int pageSize = 20) { var data = _readOnlyService.Repository <WareHouse.Infrastructure.Entities.WareHouse>().GetPaged(i => i.Name.ToString().Contains(name.ToString()) && !i.Deleted, page: page, pageSize: pageSize); var result = new PagedResult <WareHouseDto> { CurrentPage = data.CurrentPage, PageCount = data.PageCount, PageSize = data.PageSize, RowCount = data.RowCount, Results = WareHouseMapper.EntityToDtos(data.Results) }; return(Task.FromResult(result)); }
public Task <PagedResult <WareHouseDto> > GetPaged(string name, string orderBy = "", bool orderAsc = true, int page = 1, int pageSize = 20) { var data = _readOnlyService.Repository <ApplicationCore.Entities.Warehouse>().GetPaged(i => string.IsNullOrEmpty(name) || i.Name.ToLower().Contains(name.ToLower()), orderBy, orderAsc, page: page, pageSize: pageSize); var countries = ReadModelService.Read <List <CountryReadModel> >(MicroservicesConstants.CachingCountries); var provinces = ReadModelService.Read <List <ProvinceReadModel> >(MicroservicesConstants.CachingProvinces); var result = new PagedResult <WareHouseDto> { CurrentPage = data.CurrentPage, PageCount = data.PageCount, PageSize = data.PageSize, RowCount = data.RowCount, Results = WareHouseMapper.EntityToDtos(data.Results, countries, provinces) }; return(Task.FromResult(result)); }
public Task <WareHouseDto> Get(Guid id) { return(Task.FromResult(WareHouseMapper.EntityToDto(_readOnlyService.Repository <ApplicationCore.Entities.Warehouse>().Get(i => i.Id == id).FirstOrDefault()))); }
public Task <IEnumerable <WareHouseDto> > Get() { return(Task.FromResult(WareHouseMapper.EntityToDtos(_readOnlyService.Repository <WareHouse.Infrastructure.Entities.WareHouse>().Get(i => !i.Deleted).ToList()))); }