public void ProductDto_Extension_AsEntity_Null() { ProductDto product = null; var result = product.AsEntity(); Assert.IsNull(result); Assert.AreEqual(null, result); }
public GenericServiceResponse <bool> DeleteProduct(ProductDto product) { return(TryExecute <GenericServiceResponse <bool> >((response) => { response.Result = Repository.Delete(product.AsEntity()); if (!response.Result) { var errorMessage = "'DeleteProduct' was unable to delete the given product record."; response.Notifications.AddError(errorMessage); Logger.Error(errorMessage); } })); }