public void EmployeeDto_Extension_AsEntity_Null()
        {
            // Arrange
            EmployeeDto employee = null;

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

            // Assert
            Assert.IsNull(result);
            Assert.AreEqual(null, result);
        }
Beispiel #2
0
        public GenericServiceResponse <bool> DeleteEmployee(EmployeeDto employee)
        {
            return(TryExecute <GenericServiceResponse <bool> >((response) =>
            {
                response.Result = Repository.Delete(employee.AsEntity());

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