- Timestamp:
- 09/08/09 11:11:50 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs
r2339 r2344 38 38 Connect(); 39 39 if (!ctx.DatabaseExists()) 40 ctx.CreateDatabase(); 40 ctx.CreateDatabase(); 41 41 } 42 42 … … 109 109 110 110 using (ModelingDataContext ctx = new ModelingDataContext(connection)) { 111 //get all double properties to save as modelResult 112 IEnumerable<PropertyInfo> modelResultInfos = model.GetType().GetProperties().Where( 113 info => info.PropertyType == typeof(double)); 114 foreach (PropertyInfo modelResultInfo in modelResultInfos) { 115 Result result = GetOrCreateResult(modelResultInfo.Name); 116 double value = (double)modelResultInfo.GetValue(model, null); 117 ctx.ModelResults.InsertOnSubmit(new ModelResult(m, result, value)); 111 foreach (KeyValuePair<string, double> pair in model.Results) { 112 Result result = GetOrCreateResult(pair.Key); 113 ctx.ModelResults.InsertOnSubmit(new ModelResult(m, result, pair.Value)); 118 114 } 119 115 ctx.SubmitChanges(); 120 116 } 117 118 // code to store meta-information for models (gkronber (8.9.09)) 119 //using (ModelingDataContext ctx = new ModelingDataContext(connection)) { 120 // foreach (KeyValuePair<string, double> pair in model.MetaData) { 121 // MetaData metaData = GetOrCreateMetaData(pair.Key); 122 // ctx.ModelMetaData.InsertOnSubmit(new ModelMetaData(m, metaData, pair.Value)); 123 // } 124 // ctx.SubmitChanges(); 125 //} 121 126 122 127 using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
Note: See TracChangeset
for help on using the changeset viewer.