public DataAgent <int> ChangeProductQuantityInStore(ProductStoreDto productInStore) { var result = new DataAgent <int>(); try { result.Data = DbConnection.Query <int>( StoredProcedures.ProductInStoreChangeQuantity, new { productInStore.ProductId, productInStore.StoreId, productInStore.Quantity }, commandType: CommandType.StoredProcedure). SingleOrDefault(); } catch (Exception ex) { result.ResponseMessage = ex.Message; } return(result); }
public DataAgent <List <ProductStoreDto> > GetAvailabilityOfProductInStore(ProductStoreDto productInStore) { var result = new DataAgent <List <ProductStoreDto> >(); try { result.Data = DbConnection.Query <ProductStoreDto>( StoredProcedures.ProductInStoreGetAvailability, new { productInStore.ProductId, productInStore.StoreId, productInStore.Quantity }, commandType: CommandType.StoredProcedure ).ToList(); } catch (Exception ex) { result.ResponseMessage = ex.Message; } return(result); }