Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/26/13 17:36:48 (11 years ago)
Author:
pfleck
Message:

#2030
Removed unnecessary UpdatePlugins in UpdateTask.
Optimized GetTask and GetPlugin with compiled queries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HivePerformance/sources/HeuristicLab.Services.Hive/3.3/HiveDao.cs

    r9397 r9399  
    4040      select t
    4141    );
     42
     43    public Task GetTaskByDto(DT.Task taskDto) {
     44      var task = GetTaskById(taskDto.Id);
     45      DT.Convert.ToEntity(taskDto, task);
     46      return task;
     47    }
    4248
    4349    public Tuple<Task, Guid?> GetTaskByIdAndLastStateLogSlaveId(Guid taskId) {
     
    177183
    178184    #region Plugin Methods
     185    public Plugin GetPluginById(Guid pluginId) {
     186      return GetPluginByIdQuery(Db, pluginId).SingleOrDefault();
     187    }
     188
     189    private static Func<HiveDataContext, Guid, IQueryable<Plugin>> GetPluginByIdQuery = CompiledQuery.Compile((HiveDataContext db, Guid pluginId) =>
     190      from p in db.Plugins
     191      where p.PluginId == pluginId
     192      select p
     193    );
    179194
    180195    #endregion
Note: See TracChangeset for help on using the changeset viewer.