Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2205 for branches


Ignore:
Timestamp:
07/29/09 13:39:43 (15 years ago)
Author:
mkommend
Message:

added functionality in database backend to query inputvariable results (ticket #712)

Location:
branches/HeuristicLab.Modeling Database Backend/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs

    r2203 r2205  
    6060      using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
    6161        foreach (string inputVariable in algorithm.Model.InputVariables) {
    62           ctx.InputVariables.InsertOnSubmit(new InputVariable(model, variables[inputVariable]));
    63         }
     62          ctx.InputVariables.InsertOnSubmit(new InputVariable(model, variables[inputVariable]));         
     63        }
     64        ctx.SubmitChanges();
    6465      }
    6566
     
    209210    #endregion
    210211
     212    #region InputVariableResults
     213    public IEnumerable<IInputVariableResult> GetInputVariableResults(IModel model) {
     214      ModelingDataContext ctx = new ModelingDataContext(connection);
     215      DataLoadOptions dlo = new DataLoadOptions();
     216      dlo.LoadWith<InputVariableResult>(ir => ir.Variable);
     217      dlo.LoadWith<InputVariableResult>(ir => ir.Result);
     218      dlo.LoadWith<InputVariableResult>(ir => ir.Model);
     219      ctx.LoadOptions = dlo;
     220
     221      var inputResults = from ir in ctx.InputVariableResults
     222                         where ir.Model == model
     223                         select ir;
     224      return inputResults.ToList().Cast<IInputVariableResult>();
     225    }
     226
     227    #endregion
     228
    211229    #region Model
    212230    public IEnumerable<IModel> GetAllModels() {
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.Database/3.2/IModelingDatabase.cs

    r2194 r2205  
    3131    IEnumerable<IResult> GetAllResults();
    3232    IEnumerable<IModelResult> GetModelResults(IModel model);
     33    IEnumerable<IInputVariableResult> GetInputVariableResults(IModel model);
    3334  }
    3435}
Note: See TracChangeset for help on using the changeset viewer.