コード例 #1
0
        public void ProductDto_Extension_AsEntity_Null()
        {
            ProductDto product = null;
            var        result  = product.AsEntity();

            Assert.IsNull(result);
            Assert.AreEqual(null, result);
        }
コード例 #2
0
        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);
                }
            }));
        }