static void Main(string[] args) { IProductStockService productStockService = ServiceFactory.Create <IProductStockService>(); var request = new ProductStockServiceContract() { Contract = new SearchProductStockRequestContract() { ProductCode = "001" } }; request.Contract.FirstValidator(); var response = productStockService.SearchProductStockNumberByCode(request); }
public ProductStockServiceContract SearchProductStockNumberByCode(ProductStockServiceContract requestContract) { ProductStock stock = new ProductStock(); var stockNumber = stock.GetStockByProductCode(requestContract.RequestContract.ProductCode); var response = new SearchProductStockResponseContract() { ProductCode = requestContract.RequestContract.ProductCode, Request = requestContract.RequestContract, StockNumber = stockNumber }; var result = new ProductStockServiceContract() { Contract = response }; result.Contract.AfterValidator(); return(result); }