Exemplo n.º 1
0
        public async Task <ActionResult> DeleteProduct(int productID)
        {
            _orm.OpenConn();


            var productFromDB = await _orm.GetProductById(productID);

            if (productFromDB == null)
            {
                return(NotFound());
            }
            //Map from entity (Source) to nidek (Destination)
            //Apply Updated fields values to that dto
            //Map from model (Source) to entity (Destination)
            //aka. copying values from source to destination
            await _orm.DeleteProduct(productID);

            await _orm.CloseConn();

            return(NoContent());
        }