コード例 #1
0
        public void CustomerDto_Extension_AsEntity_Null()
        {
            // Arrange
            CustomerDto customer = null;

            // Act
            var result = customer.AsEntity();

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

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