예제 #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 Feature To(FeatureAPI item, bool includeRequirements = true)
 {
     if (item != null)
     {
         return(new Feature
         {
             ID = item.ID,
             Title = item.Title,
             Status = item.Status,
             Requirements = includeRequirements ? RequirementAPI.To(item.Requirements) : null,
             IsNew = item.IsNew
         });
     }
     else
     {
         return(null);
     }
 }
예제 #3
0
 public static Requirement To(RequirementAPI item, bool includeTasks = true, bool includeComments = true)
 {
     if (item != null)
     {
         return(new Requirement
         {
             ID = item.ID,
             Title = item.Title,
             Status = item.Status,
             Tasks = includeTasks ? TaskAPI.To(item.Tasks) : null,
             Comments = includeComments ? RequirementCommentAPI.To(item.Comments) : null,
             FeatureID = item.FeatureID,
             Feature = FeatureAPI.To(item.Feature),
             IsNew = item.IsNew
         });
     }
     else
     {
         return(null);
     }
 }
예제 #4
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
         });
     }
 }
예제 #5
0
 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
         });
     }
 }