public StockContract GetStockListByTransaction(ITransaction Transaction) { StockContract retunobject = new StockContract(); switch (Transaction.TransactionType) { case TransactionType.Purchase: retunobject.StockList = StockRepo.GetStockListByPrucahseID(Transaction.ID).ToList(); break; case TransactionType.Sale: retunobject.StockList = StockRepo.GetStockListBySaleID(Transaction.ID).ToList(); break; } return(retunobject); }