Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/11 02:04:07 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

Location:
branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Administration
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Administration/AdministrationService.cs

    r5534 r5679  
    3333  public class AdministrationService : IAdministrationService {
    3434    #region Platform Methods
     35    public DataTransfer.Platform GetPlatform(long id) {
     36      using (OKBDataContext okb = new OKBDataContext()) {
     37        return Convert.ToDto(okb.Platforms.FirstOrDefault(x => x.Id == id));
     38      }
     39    }
    3540    public IEnumerable<DataTransfer.Platform> GetPlatforms() {
    3641      using (OKBDataContext okb = new OKBDataContext()) {
     
    6368
    6469    #region AlgorithmClass Methods
     70    public DataTransfer.AlgorithmClass GetAlgorithmClass(long id) {
     71      using (OKBDataContext okb = new OKBDataContext()) {
     72        return Convert.ToDto(okb.AlgorithmClasses.FirstOrDefault(x => x.Id == id));
     73      }
     74    }
    6575    public IEnumerable<DataTransfer.AlgorithmClass> GetAlgorithmClasses() {
    6676      using (OKBDataContext okb = new OKBDataContext()) {
     
    93103
    94104    #region Algorithm Methods
     105    public DataTransfer.Algorithm GetAlgorithm(long id) {
     106      using (OKBDataContext okb = new OKBDataContext()) {
     107        return Convert.ToDto(okb.Algorithms.FirstOrDefault(x => x.Id == id));
     108      }
     109    }
    95110    public IEnumerable<DataTransfer.Algorithm> GetAlgorithms() {
    96111      using (OKBDataContext okb = new OKBDataContext()) {
     
    150165
    151166    #region ProblemClass Methods
     167    public DataTransfer.ProblemClass GetProblemClass(long id) {
     168      using (OKBDataContext okb = new OKBDataContext()) {
     169        return Convert.ToDto(okb.ProblemClasses.FirstOrDefault(x => x.Id == id));
     170      }
     171    }
    152172    public IEnumerable<DataTransfer.ProblemClass> GetProblemClasses() {
    153173      using (OKBDataContext okb = new OKBDataContext()) {
     
    180200
    181201    #region Problem Methods
     202    public DataTransfer.Problem GetProblem(long id) {
     203      using (OKBDataContext okb = new OKBDataContext()) {
     204        return Convert.ToDto(okb.Problems.FirstOrDefault(x => x.Id == id));
     205      }
     206    }
    182207    public IEnumerable<DataTransfer.Problem> GetProblems() {
    183208      using (OKBDataContext okb = new OKBDataContext()) {
  • branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Administration/IAdministrationService.cs

    r5482 r5679  
    3434    #region Platform Methods
    3535    [OperationContract]
     36    Platform GetPlatform(long id);
     37    [OperationContract]
    3638    IEnumerable<Platform> GetPlatforms();
    3739    [OperationContract]
     
    4547    #region AlgorithmClass Methods
    4648    [OperationContract]
     49    AlgorithmClass GetAlgorithmClass(long id);
     50    [OperationContract]
    4751    IEnumerable<AlgorithmClass> GetAlgorithmClasses();
    4852    [OperationContract]
     
    5559
    5660    #region Algorithm Methods
     61    [OperationContract]
     62    Algorithm GetAlgorithm(long id);
    5763    [OperationContract]
    5864    IEnumerable<Algorithm> GetAlgorithms();
     
    7581    #region ProblemClass Methods
    7682    [OperationContract]
     83    ProblemClass GetProblemClass(long id);
     84    [OperationContract]
    7785    IEnumerable<ProblemClass> GetProblemClasses();
    7886    [OperationContract]
     
    8593
    8694    #region Problem Methods
     95    [OperationContract]
     96    Problem GetProblem(long id);
    8797    [OperationContract]
    8898    IEnumerable<Problem> GetProblems();
Note: See TracChangeset for help on using the changeset viewer.