Exemplo n.º 1
0
        private TaskEntity CopyTaskTo(IDelta<ITask> task, TaskEntity taskEntity)
        {

            if(task.CanUpdate(x=>x.Id))
            {
                taskEntity.Id = task.Instance.Id;
            }

            if (task.CanUpdate(x => x.CreatedDateTime))
            {
                taskEntity.CreatedDateTime = task.Instance.CreatedDateTime;
            }

            if (task.CanUpdate(x => x.Author))
            {
                taskEntity.AuthorId = task.Instance.Author.Id;
            }

            if (task.CanUpdate(x => x.Manager))
            {
                taskEntity.ManagerId = task.Instance.Manager.Id;
            }

            if (task.CanUpdate(x => x.ToEmployee))
            {
                taskEntity.EmployeeId = task.Instance.ToEmployee.Id;
            }

            if (task.CanUpdate(x => x.Name))
            {
                taskEntity.Name = task.Instance.Name;
            }

            if (task.CanUpdate(x => x.Objective))
            {
                taskEntity.Objective = task.Instance.Objective;
            }

            if (task.CanUpdate(x => x.Status))
            {
                taskEntity.StatusId = task.Instance.Status.Id;
            }

            if (task.CanUpdate(x => x.Priority))
            {
                taskEntity.PriorityId = task.Instance.Priority.Id;
            }

            if (task.CanUpdate(x => x.StartDateTime))
            {
                taskEntity.StartDateTime = task.Instance.StartDateTime;
            }

            if (task.CanUpdate(x => x.EndDateTime))
            {
                taskEntity.EndDateTime = task.Instance.EndDateTime;
            }

            if (task.CanUpdate(x => x.Result))
            {
                taskEntity.Result = task.Instance.Result;
            }

            if (task.CanUpdate(x => x.Description))
            {
                taskEntity.Description = task.Instance.Description;
            }

            return taskEntity;
        }