Exemplo n.º 1
0
        public async Task <ProductApiModel> CreateAsync(ProductApiModel productApiModel)
        {
            // Transaction is being used here just as an example (let's consider that more than one operation could happen below)
            this.BeginTransaction();

            var newProduct = await this._productService.CreateAsync(productApiModel.Adapt <Product>());

            this.Commit();

            return(newProduct.Adapt <ProductApiModel>());
        }
Exemplo n.º 2
0
        public async Task UpdateAsync(ProductApiModel product)
        {
            await this._productService.UpdateAsync(product.Adapt <Product>());

            this.Commit();
        }