- Timestamp:
- 09/02/09 16:48:56 (15 years ago)
- 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 32 32 public Model() { 33 33 targetVariable = default(EntityRef<Variable>); 34 algorithm = default(EntityRef<Algorithm>); 34 algorithm = default(EntityRef<Algorithm>); 35 35 } 36 36 … … 94 94 } 95 95 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 96 103 private int trainingSamplesStart; 97 104 [Column(Storage = "trainingSamplesStart", CanBeNull = false)] -
trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs
r2314 r2326 264 264 } 265 265 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 266 274 public byte[] GetModelData(IModel model) { 267 275 var data = (from md in ctx.ModelData … … 273 281 } 274 282 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 275 290 public IPredictor GetModelPredictor(IModel model) { 276 291 byte[] data = GetModelData(model);
Note: See TracChangeset
for help on using the changeset viewer.