using System; using System.Collections.Generic; using System.Linq; using System.Data.Linq; using System.Data.Linq.Mapping; using System.Text; namespace HeuristicLab.Modeling.SQLiteBackend { [Table(Name = "Result")] public class Result { public Result() { } public Result(string name) : this() { this.name = name; } private int id; [Column(Storage = "id", IsPrimaryKey = true, IsDbGenerated = true)] public int Id { get { return this.id; } set { this.id = value; } } private string name; [Column(Storage = "name", CanBeNull = false)] public string Name { get { return this.name; } private set { this.name = value; } } public Dictionary ModelResultValues { get { using (ModelingDataContext ctx = new ModelingDataContext()) { var x = (from modelResult in ctx.ModelResults where modelResult.Result == this select modelResult).ToDictionary( mr => mr.Model, mr => mr.Value); return x; } } } } }