public IActionResult Get(string tableID = "", bool list = false) { List <Release> all = js.All <Release>(); List <Release> filterd; List <Release> output; if (!string.IsNullOrWhiteSpace(tableID)) { Table t = js.Single <Table>(tableID); RDSystem s = js.Single <RDSystem>(t.SystemID); filterd = js.All <Release>().Where(r => r.SystemID == s.ID).ToList(); } else { filterd = all; } if (list) { output = new List <Release>(); filterd.ForEach(c => output.Add(new Release() { Name = c.Name, Active = c.Active, ID = c.ID, SystemID = c.SystemID })); } else { output = filterd; } return(StatusCode(200, output)); }
public IActionResult Get(string id) { List <string> files = new List <string>(); files.Add("edu.json"); files.Add("ce.json"); files.Add("fi.json"); files.Add("fs.json"); files.Add("ss.json"); files.Add("trc.json"); foreach (string x in files) { SaveTableToFile(x); } return(StatusCode(201, js.Single <RDSystem>(id))); }
public IActionResult Get(string id) { return(StatusCode(200, js.Single <Table>(id))); }
public IActionResult Get(string tableID = "", bool ignoreChanges = false, bool list = false) { List <ChangeSet> allchanges; List <ChangeSet> filterdList; List <ChangeSet> output; allchanges = js.All <ChangeSet>(); if (!string.IsNullOrWhiteSpace(tableID)) { if (ignoreChanges) { Table t = js.Single <Table>(tableID); RDSystem s = js.Single <RDSystem>(t.SystemID); List <Release> rel = js.All <Release>().Where(r => r.SystemID == s.ID).ToList(); HashSet <string> uniqueReleaseIDs = new HashSet <string>(); rel.ForEach(r => uniqueReleaseIDs.Add(r.ID)); filterdList = new List <ChangeSet>(); foreach (ChangeSet c in allchanges) { if (uniqueReleaseIDs.Contains(c.ReleaseID)) { filterdList.Add(c); } } } else { List <Change> changes = js.All <Change>().Where(c => c.TableID == tableID).ToList(); HashSet <string> uniqueCSIds = new HashSet <string>(); changes.ForEach(c => uniqueCSIds.Add(c.ChangeSetID)); filterdList = new List <ChangeSet>(); foreach (ChangeSet c in allchanges) { if (uniqueCSIds.Contains(c.ID)) { filterdList.Add(c); } } } } else { filterdList = allchanges; } if (list) { output = new List <ChangeSet>(); filterdList.ForEach(c => output.Add(new ChangeSet() { Name = c.Name, Active = c.Active, ID = c.ID, ReleaseID = c.ReleaseID })); } else { output = filterdList; foreach (ChangeSet cs in output) { cs.Changes = js.All <Change>().Where(c => c.ChangeSetID == cs.ID).ToList(); } } return(StatusCode(200, output)); }