- Timestamp:
- 03/08/12 20:44:53 (13 years ago)
- Location:
- branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj
r7574 r7589 147 147 <Compile Include="Query\DataTransfer\BoolValue.cs" /> 148 148 <Compile Include="Query\DataTransfer\CombinedFilter.cs" /> 149 <Compile Include="Query\DataTransfer\ValueName.cs" /> 149 150 <Compile Include="Query\DataTransfer\NameOrdinalComparisonTimeSpanFilter.cs" /> 150 151 <Compile Include="Query\DataTransfer\OrdinalComparisonTimeSpanFilter.cs" /> -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Query/Convert.cs
r7574 r7589 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using DA = HeuristicLab.Services.OKB.DataAccess; … … 32 33 dto.ParameterValues = source.Values.Where(x => x.ValueName.Category == DA.ValueNameCategory.Parameter).Select(x => Convert.ToDto(x, includeBinaryValues)).ToArray(); 33 34 dto.ResultValues = source.Values.Where(x => x.ValueName.Category == DA.ValueNameCategory.Result).Select(x => Convert.ToDto(x, includeBinaryValues)).ToArray(); 35 return dto; 36 } 37 38 public static DT.Run ToDto(DA.Run source, bool includeBinaryValues, IEnumerable<DT.ValueName> valueNames) { 39 if (source == null) return null; 40 var dto = new DT.Run { Id = source.Id, Algorithm = Convert.ToDto(source.Algorithm), Problem = Convert.ToDto(source.Problem), CreatedDate = source.CreatedDate, ClientId = source.ClientId, UserId = source.UserId }; 41 dto.ParameterValues = source.Values.Where(x => x.ValueName.Category == DA.ValueNameCategory.Parameter && valueNames.Count(y => y.Name == x.ValueName.Name) > 0).Select(x => Convert.ToDto(x, includeBinaryValues)).ToArray(); 42 dto.ResultValues = source.Values.Where(x => x.ValueName.Category == DA.ValueNameCategory.Result && valueNames.Count(y => y.Name == x.ValueName.Name) > 0).Select(x => Convert.ToDto(x, includeBinaryValues)).ToArray(); 34 43 return dto; 35 44 } … … 74 83 } 75 84 } 85 86 public static DT.ValueName ToDto(DA.ValueName source) { 87 if (source == null) return null; 88 return new DT.ValueName() { Id = source.Id, Category = source.Category, Name = source.Name }; 89 } 76 90 } 77 91 } -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Query/IQueryService.cs
r7331 r7589 42 42 [OperationContract] 43 43 IEnumerable<Run> GetRuns(IEnumerable<long> ids, bool includeBinaryValues); 44 45 [OperationContract] 46 IEnumerable<Run> GetRunsWithValues(IEnumerable<long> ids, bool includeBinaryValues, IEnumerable<DataTransfer.ValueName> valueNames); 47 48 [OperationContract] 49 IEnumerable<ValueName> GetValueNames(); 44 50 } 45 51 } -
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Query/QueryService.cs
r7574 r7589 258 258 } 259 259 260 public IEnumerable<DataTransfer.Run> GetRunsWithValues(IEnumerable<long> ids, bool includeBinaryValues, IEnumerable<DataTransfer.ValueName> valueNames) { 261 using (OKBDataContext okb = new OKBDataContext()) { 262 DataLoadOptions dlo = new DataLoadOptions(); 263 // TODO: specify LoadWiths 264 okb.LoadOptions = dlo; 265 266 return okb.Runs.Where(x => ids.Contains(x.Id)).Select(x => Convert.ToDto(x, includeBinaryValues, valueNames)).ToArray(); 267 } 268 } 269 270 public IEnumerable<DataTransfer.ValueName> GetValueNames() { 271 using (OKBDataContext okb = new OKBDataContext()) { 272 return okb.ValueNames.Select(x => Convert.ToDto(x)).ToArray(); 273 } 274 } 275 260 276 private IQueryable<DataAccess.Run> FilterRuns(IQueryable<DataAccess.Run> runs, Filter filter) { 261 277 IFilter f = (IFilter)Activator.CreateInstance(Type.GetType(filter.FilterTypeName), filter);
Note: See TracChangeset
for help on using the changeset viewer.