Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLServerCompactBackend/3.2/InputVariableResult.cs @ 2180

Last change on this file since 2180 was 2180, checked in by mkommend, 15 years ago

added additional project for SQLServerCompact support (ticket #712)

File size: 2.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Data.Linq;
4using System.Data.Linq.Mapping;
5using System.Text;
6
7namespace HeuristicLab.Modeling.SQLServerCompactBackend {
8  [Table(Name="InputVariableResult")]
9  public class InputVariableResult {
10    public InputVariableResult() {
11      this.model = default(EntityRef<Model>);
12      this.variable = default(EntityRef<Variable>);
13      this.result = default(EntityRef<Result>);
14    }
15
16    private int variableId;
17    [Column(Storage = "variableId", IsPrimaryKey = true)]
18    public int VariableId {
19      get { return this.variableId; }
20      private set {
21        if (variableId != value) {
22          if (variable.HasLoadedOrAssignedValue)
23            throw new ForeignKeyReferenceAlreadyHasValueException();
24          variableId = value;
25        }
26      }
27    }
28
29    private EntityRef<Variable> variable;
30    [Association(Storage = "variable", ThisKey = "VariableId", OtherKey = "Id", IsForeignKey = true)]
31    public Variable Variable {
32      get { return variable.Entity; }
33    }
34
35    private int modelId;
36    [Column(Storage = "modelId", IsPrimaryKey = true)]
37    public int ModelId {
38      get { return this.modelId; }
39      private set {
40        if (modelId != value) {
41          if (model.HasLoadedOrAssignedValue)
42            throw new ForeignKeyReferenceAlreadyHasValueException();
43          modelId = value;
44        }
45      }
46    }
47
48    private EntityRef<Model> model;
49    [Association(Storage = "model", ThisKey = "ModelId", OtherKey = "Id", IsForeignKey = true)]
50    public Model Model {
51      get { return model.Entity; }
52    }
53
54    private int resultId;
55    [Column(Storage = "resultId", IsPrimaryKey = true)]
56    public int ResultId {
57      get { return this.resultId; }
58      private set {
59        if (resultId != value) {
60          if (result.HasLoadedOrAssignedValue)
61            throw new ForeignKeyReferenceAlreadyHasValueException();
62          resultId = value;
63        }
64      }
65    }
66
67    private EntityRef<Result> result;
68    [Association(Storage = "result", ThisKey = "ResultId", OtherKey = "Id", IsForeignKey = true)]
69    public Result Result {
70      get { return result.Entity; }
71    }
72  }
73}
Note: See TracBrowser for help on using the repository browser.