示例#1
0
 public static FeatureAPI From(Feature item, bool includeTasks = true)
 {
     if (item != null)
     {
         return(new FeatureAPI
         {
             ID = item.ID,
             Title = item.Title,
             Status = item.Status,
             Requirements = includeTasks && item.Requirements != null?RequirementAPI.From(item.Requirements).ToList() : null,
                                IsNew = item.IsNew
         });
     }
     else
     {
         return(null);
     }
 }
示例#2
0
 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
         });
     }
 }