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); } }
public static RequirementAPI From(Requirement item, bool includeTasks = true, bool includeComments = true) { if (item != null) { return(new RequirementAPI { ID = item.ID, Title = item.Title, Status = item.Status, Tasks = includeTasks && item.Tasks != null?TaskAPI.From(item.Tasks).ToList() : null, Comments = includeComments && item.Comments != null?RequirementCommentAPI.From(item.Comments).ToList() : null, FeatureID = item.FeatureID, Feature = FeatureAPI.From(item.Feature, false), IsNew = item.IsNew }); } else { return(null); } }
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); } }