Exemple #1
0
        public void TaskDto_Extension_AsEntity_Null()
        {
            TaskDto task   = null;
            var     result = task.AsEntity();

            Assert.IsNull(result);
            Assert.AreEqual(null, result);
        }
        public GenericServiceResponse <bool> DeleteTask(TaskDto task)
        {
            return(TryExecute <GenericServiceResponse <bool> >((response) =>
            {
                response.Result = Repository.Delete(task.AsEntity());

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