コード例 #1
0
        public void SupplierDto_Extension_AsEntity_Null()
        {
            SupplierDto supplier = null;
            var         result   = supplier.AsEntity();

            Assert.IsNull(result);
            Assert.AreEqual(null, result);
        }
コード例 #2
0
        public GenericServiceResponse <bool> DeleteSupplier(SupplierDto supplier)
        {
            return(TryExecute <GenericServiceResponse <bool> >((response) =>
            {
                response.Result = Repository.Delete(supplier.AsEntity());

                if (!response.Result)
                {
                    var errorMessage = "'DeleteSupplier' was unable to delete the given supplier record.";
                    response.Notifications.AddError(errorMessage);
                    Logger.Error(errorMessage);
                }
            }));
        }