public PurchaseMasterData GetInitilize() { PurchaseMasterData masterData = new PurchaseMasterData(); masterData.CatalogItems = _unitOfWork.GetRepository <CatalogItem>().GetList(index: 0, size: 1000, include: x => x.Include(n => n.Properties).ThenInclude(m => m.PropertyMaster)).Items; masterData.Sellers = _unitOfWork.GetRepository <Seller>().GetList( orderBy: x => x.OrderBy(m => m.Created), include: x => x.Include(a => a.BusinessContact).ThenInclude(a => a.ContactAddress), index: 0, size: 1000).Items; masterData.PurchaseBook = _unitOfWork.GetRepository <AccountBook>().Single(predicate: x => x.ProgrammerId == AccountBookEnum.Purchase.ToString()); masterData.GstBook = _unitOfWork.GetRepository <AccountBook>().Single(predicate: x => x.ProgrammerId == AccountBookEnum.GstBook.ToString()); masterData.CashBook = _unitOfWork.GetRepository <AccountBook>().Single(predicate: x => x.ProgrammerId == AccountBookEnum.Cash.ToString()); masterData.VoucherTypeMaster = _unitOfWork.GetRepository <VoucherTypeMaster>().Single(predicate: x => x.ProgrammerId == VoucherTypeMasterEnum.Purchase.ToString()); return(masterData); }
public PurchaseMasterData GetInitilize() { HttpResponseMessage response = _httpClient.GetAsync("Purchase/Init").Result; PurchaseMasterData MasterData = null; if (response.StatusCode == HttpStatusCode.OK) { var json = response.Content.ReadAsStringAsync().ConfigureAwait(true) .GetAwaiter() .GetResult(); MasterData = JsonConvert.DeserializeObject <PurchaseMasterData>(json); return(MasterData); } throw new Exception("Failed"); }