- Timestamp:
- 01/13/09 15:07:31 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSet.cs
r1106 r1116 48 48 // lazy loading of problem from DB 49 49 if (problem == null) { 50 IList<Statement>persistedData = Store.Select(new Statement(new Entity(Ontology.CedmaNameSpace + Guid), Ontology.PredicateSerializedData, Ontology.AnyEntity));51 if (persistedData.Count == 1) {52 Literal persistedLiteral = (Literal)persistedData [0].Property;50 var persistedData = Store.Select(new Statement(new Entity(Ontology.CedmaNameSpace + Guid), Ontology.PredicateSerializedData, Ontology.AnyEntity)); 51 if (persistedData.Count() == 1) { 52 Literal persistedLiteral = (Literal)persistedData.First().Property; 53 53 this.problem = (Problem)PersistenceManager.RestoreFromGZip(Convert.FromBase64String((string)persistedLiteral.Value)); 54 54 } else 55 55 this.problem = new Problem(); // no entry in the DB => create a new problem 56 56 } 57 return problem; 57 return problem; 58 58 } 59 59 } … … 69 69 Store = store; 70 70 guid = new Guid(dataSetEntity.Uri.Remove(0, Ontology.CedmaNameSpace.Length)); 71 IList<Statement>names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity));72 if (names.Count > 0) name = (string)((Literal)names[0].Property).Value;71 var names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity)); 72 if (names.Count() > 0) name = (string)((Literal)names.First().Property).Value; 73 73 else name = guid.ToString(); 74 74 }
Note: See TracChangeset
for help on using the changeset viewer.