Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/02/09 16:48:56 (15 years ago)
Author:
mkommend
Message:

added name in IModel
added update methods for IModel and ModelData
(ticket #712)

Location:
trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DataObjects/Model.cs

    r2293 r2326  
    3232    public Model() {
    3333      targetVariable = default(EntityRef<Variable>);
    34       algorithm = default(EntityRef<Algorithm>);
     34      algorithm = default(EntityRef<Algorithm>);     
    3535    }
    3636
     
    9494    }
    9595
     96    private string name;
     97    [Column(Storage = "name", CanBeNull = true)]
     98    public string Name {
     99      get { return this.name; }
     100      set { this.name = value; }
     101    }
     102
    96103    private int trainingSamplesStart;
    97104    [Column(Storage = "trainingSamplesStart", CanBeNull = false)]
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs

    r2314 r2326  
    264264    }
    265265
     266    public void UpdateModel(IModel model) {
     267      Model m = (Model)model;
     268      Model orginal = ctx.Models.GetOriginalEntityState(m);
     269      if (orginal == null)
     270        ctx.Models.Attach(m);
     271      ctx.SubmitChanges();
     272    }
     273
    266274    public byte[] GetModelData(IModel model) {
    267275      var data = (from md in ctx.ModelData
     
    273281    }
    274282
     283    public void UpdateModelData(IModel model, byte[] modelData) {
     284      Model m = (Model)model;
     285      ctx.ModelData.DeleteAllOnSubmit(ctx.ModelData.Where(x => x.Model == m));
     286      ctx.ModelData.InsertOnSubmit(new ModelData(m, modelData));
     287      ctx.SubmitChanges();
     288    }
     289
    275290    public IPredictor GetModelPredictor(IModel model) {
    276291      byte[] data = GetModelData(model);
Note: See TracChangeset for help on using the changeset viewer.