public static List <Selection> selectionsOfDefaultTemplateWithTaskId(int taskId) { TaskTemplate defaultTemplate = null; List <Entity> templates = TaskTemplate.where (new Query("TaskTemplate").addTypeQuery(TypeQuery.select) .addCondition("TaskID", "=", taskId.ToString()), typeof(TaskTemplate)); if (templates.Count == 0) { return(new List <Selection>()); } int i = 0; List <Selection> selections = new List <Selection>(); foreach (models.Entity template in templates) { List <Selection> temp = Selection.where (new Query("Selection").addTypeQuery(TypeQuery.select) .addCondition("TaskTemplateID", "=", template.ID.ToString()), typeof(Selection)).Cast <Selection>().ToList(); selections = selections.Concat(temp).ToList(); } return(selections); }
public static List <TaskTemplate> templatesOfTaskId(int taskId) { return(TaskTemplate.where (new Query("TaskTemplate").addTypeQuery(TypeQuery.select) .addCondition("TaskID", "=", taskId.ToString()), typeof(TaskTemplate)).Cast <TaskTemplate>().ToList()); }