Changeset 2179 for branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLiteBackend/3.2/Result.cs
- Timestamp:
- 07/23/09 11:01:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLiteBackend/3.2/Result.cs
r2178 r2179 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 3 4 using System.Data.Linq; 4 5 using System.Data.Linq.Mapping; … … 11 12 } 12 13 14 public Result(string name) 15 : this() { 16 this.name = name; 17 } 18 13 19 private int id; 14 [Column(Storage = "id", DbType = "integer", IsPrimaryKey = true, IsDbGenerated = true, UpdateCheck = UpdateCheck.Never)]20 [Column(Storage = "id", IsPrimaryKey = true, IsDbGenerated = true)] 15 21 public int Id { 16 22 get { return this.id; } … … 19 25 20 26 private string name; 21 [Column(Storage = "name", DbType = "VarChar(50) NOT NULL",CanBeNull = false)]27 [Column(Storage = "name", CanBeNull = false)] 22 28 public string Name { 23 29 get { return this.name; } … … 25 31 } 26 32 33 public Dictionary<Model, double> ModelResultValues { 34 get { 35 using (ModelingDataContext ctx = new ModelingDataContext()) { 36 var x = (from modelResult in ctx.ModelResults 37 where modelResult.Result == this 38 select modelResult).ToDictionary( 39 mr => mr.Model, 40 mr => mr.Value); 41 return x; 42 } 43 } 44 } 45 27 46 } 28 47 }
Note: See TracChangeset
for help on using the changeset viewer.