public List <Experiment> GetAll() { var columns = new List <string> { "ID", "name", "description", "goal", "result", "summary" }; var experiments = Db.GetAll("Experiments", columns); var es = (from experiment in experiments let eId = Convert.ToInt32(experiment["ID"]) let name = experiment["name"] let paramColumns = new List <string> { "name", "value" } let ps = Db.GetAll("Parameters", "experiment", eId.ToString(), paramColumns) let parameters = ps.ToDictionary(parameter => parameter["name"], parameter => parameter["value"]) select new Experiment(eId, name) { Description = experiment["description"], Goal = experiment["goal"], Result = Convert.ToDouble(experiment["result"]), Summary = experiment["summary"], Parameters = parameters }).ToList(); foreach (var e in es) { var measurements = _measurementsDAO.GetAll(e); e.AddMeasurements(measurements); } return(es); }
public List <Measurement> GetAllMeasurements(Experiment e) { return(_measurements.GetAll(e)); }