Beispiel #1
0
 public async Task UpdateProduct(ProductDataEntity product)
 {
     using (var connection = new SqlConnection(_databaseConfiguration.ConnectionString))
     {
         await connection.ExecuteAsync(_updateProduct, product);
     }
 }
        public Task UpdateProduct(ProductDataEntity product)
        {
            _products = _products.Where(p => p.Id != product.Id).ToList();

            _products.Add(product);

            return(Task.CompletedTask);
        }
Beispiel #3
0
        public async Task <ProductDataEntity> AddProduct(ProductDataEntity product)
        {
            using (var connection = new SqlConnection(_databaseConfiguration.ConnectionString))
            {
                await connection.ExecuteAsync(_insertNewProduct, product);

                return(product);
            }
        }
Beispiel #4
0
 public Task UpdateProduct(ProductDataEntity product)
 {
     throw new NotImplementedException();
 }
Beispiel #5
0
 public Task <ProductDataEntity> AddProduct(ProductDataEntity product)
 {
     throw new NotImplementedException();
 }
        public Task <ProductDataEntity> AddProduct(ProductDataEntity product)
        {
            _products.Add(product);

            return(Task.FromResult(product));
        }