Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 16:46:35 (12 years ago)
Author:
gkronber
Message:

#1847: merged r8084:8205 from trunk into GP move operators branch

Location:
branches/GP-MoveOperators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators

  • branches/GP-MoveOperators/HeuristicLab.Services.Access/3.3/AccessService.cs

    r8040 r8206  
    744744      var g = group; //linq does not like vars called group
    745745
    746       using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) {
    747         var query = from ug in context.UserGroupBases.OfType<DA.UserGroup>()
    748                     where ug.Id == g.Id
    749                     select ug;
    750         if (query.Count() > 0) {
    751           context.UserGroupBases.DeleteOnSubmit(query.First());
    752           context.SubmitChanges();
    753         } else {
    754           throw new Exception("UserGroup with id " + g.Id + " does not exist.");
     746      if (g.Id != null && g.Id != Guid.Empty) {
     747        using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) {
     748          var query = from ug in context.UserGroupBases.OfType<DA.UserGroup>()
     749                      where ug.Id == g.Id
     750                      select ug;
     751          if (query.Count() > 0) {
     752            context.UserGroupBases.DeleteOnSubmit(query.First());
     753            context.SubmitChanges();
     754          } else {
     755            throw new Exception("UserGroup with id " + g.Id + " does not exist.");
     756          }
    755757        }
    756758      }
Note: See TracChangeset for help on using the changeset viewer.