Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9259


Ignore:
Timestamp:
02/28/13 15:57:50 (12 years ago)
Author:
ascheibe
Message:

#2019 improved resource assigning method

File:
1 edited

Legend:

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

    r9257 r9259  
    615615    public void AssignJobToResource(Guid taskId, IEnumerable<Guid> resourceIds) {
    616616      using (var db = CreateContext()) {
    617         var task = db.Tasks.Where(x => x.TaskId == taskId).Single();
     617        List<AssignedResource> assignedResources = new List<AssignedResource>();
    618618        foreach (Guid rId in resourceIds) {
    619           task.AssignedResources.Add(new AssignedResource() { TaskId = taskId, ResourceId = rId });
    620         }
     619          assignedResources.Add(new AssignedResource() { TaskId = taskId, ResourceId = rId });
     620        }
     621        db.AssignedResources.InsertAllOnSubmit(assignedResources);
    621622        db.SubmitChanges();
    622623      }
Note: See TracChangeset for help on using the changeset viewer.