public static TaskComment To(TaskCommentAPI item) { return(new TaskComment { ID = item.ID, Comment = item.Comment, TaskID = item.TaskID }); }
public static Task To(TaskAPI item, bool includeTaskLogs = true, bool includeComments = true) { if (item == null) { return(null); } else { return(new Task { ID = item.ID, Title = item.Title, TaskType = item.TaskType, IsActive = item.IsActive, CheckIns = TaskCheckInAPI.To(item.CheckIns), Logs = includeTaskLogs ? TaskLogAPI.To(item.Logs) : null, Comments = includeComments ? TaskCommentAPI.To(item.Comments) : null, RequirementID = item.RequirementID, Requirement = RequirementAPI.To(item.Requirement), IsNew = item.IsNew }); } }
public static TaskAPI From(Task item, bool includeTaskLogs = true, bool includeComments = true) { if (item == null) { return(null); } else { return(new TaskAPI { ID = item.ID, Title = item.Title, TaskType = item.TaskType, IsActive = item.IsActive, CheckIns = item.CheckIns != null?TaskCheckInAPI.From(item.CheckIns).ToList() : null, Logs = includeTaskLogs && item.Logs != null?TaskLogAPI.From(item.Logs).ToList() : null, Comments = includeComments && item.Comments != null?TaskCommentAPI.From(item.Comments).ToList() : null, RequirementID = item.RequirementID, Requirement = RequirementAPI.From(item.Requirement, false), IsNew = item.IsNew }); } }