Last change
on this file since 2181 was
2181,
checked in by mkommend, 15 years ago
|
added generated classes from DBLinq for sqlite support (ticket #712)
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2178] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
[2179] | 3 | using System.Linq;
|
---|
[2178] | 4 | using System.Data.Linq;
|
---|
| 5 | using System.Data.Linq.Mapping;
|
---|
| 6 | using System.Text;
|
---|
| 7 |
|
---|
| 8 | namespace HeuristicLab.Modeling.SQLiteBackend {
|
---|
| 9 | [Table(Name = "Result")]
|
---|
| 10 | public class Result {
|
---|
| 11 | public Result() {
|
---|
| 12 | }
|
---|
| 13 |
|
---|
[2179] | 14 | public Result(string name)
|
---|
| 15 | : this() {
|
---|
| 16 | this.name = name;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
[2178] | 19 | private int id;
|
---|
[2179] | 20 | [Column(Storage = "id", IsPrimaryKey = true, IsDbGenerated = true)]
|
---|
[2178] | 21 | public int Id {
|
---|
| 22 | get { return this.id; }
|
---|
[2181] | 23 | set { this.id = value; }
|
---|
[2178] | 24 | }
|
---|
| 25 |
|
---|
| 26 | private string name;
|
---|
[2179] | 27 | [Column(Storage = "name", CanBeNull = false)]
|
---|
[2178] | 28 | public string Name {
|
---|
| 29 | get { return this.name; }
|
---|
| 30 | private set { this.name = value; }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
[2179] | 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 |
|
---|
[2178] | 46 | }
|
---|
| 47 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.