Esempio n. 1
0
 public ActionResult PostProduct(ProductDto product)
 {
     try
     {
         product = _productConverter.FromDO(_productsService.CreateProduct(_productConverter.ToDO(product)));
         return(CreatedAtAction("GetProduct", new { id = product.Id }, product));
     } catch (InvalidArgumentException e)
     {
         return(BadRequest(e.Message));
     }
 }
        public void ToDoTest_WhenDtoIsNullReturnsNull()
        {
            Product model = converter.ToDO(null);

            Assert.IsNull(model);
        }