Free cookie consent management tool by TermsFeed Policy Generator

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

Worked on OKB (#1174)

File:
1 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()) {
Note: See TracChangeset for help on using the changeset viewer.