Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Avoid Iesi-specific collection methods.

  • Loading branch information...
commit 7ddce60a02eefd8964733aa7af5ec1a9cce588f0 1 parent b72c5cc
Oskar Berggren oskarb authored
2  src/NHibernate.Test/NHSpecificTest/NH1028/Fixture.cs
@@ -51,7 +51,7 @@ public void CanLoadCollectionUsingLeftOuterJoin()
51 51 Assert.AreEqual (shipName, loadedShip.Name);
52 52 }
53 53
54   - Assert.IsTrue (loadedItem.Containers.IsEmpty);
  54 + Assert.That(loadedItem.Containers, Is.Empty);
55 55 }
56 56 using (ISession s = OpenSession())
57 57 {
4 src/NHibernate.Test/NHSpecificTest/NH1810/Children.cs
@@ -53,10 +53,6 @@ public Children(ICollection<Child> initialValues) : base(initialValues)
53 53 behaviour = new ChildrenBehaviour(this);
54 54 }
55 55
56   - public Children(ICollection initialValues) : base(initialValues)
57   - {
58   - behaviour = new ChildrenBehaviour(this);
59   - }
60 56
61 57 public Children(ICollection<Child> initialValues, IComparer<Child> comparer) : base(initialValues, comparer)
62 58 {
2  src/NHibernate/Mapping/AbstractAuxiliaryDatabaseObject.cs
@@ -47,7 +47,7 @@ public HashedSet<string> DialectScopes
47 47 public bool AppliesToDialect(Dialect.Dialect dialect)
48 48 {
49 49 // empty means no scoping
50   - return dialectScopes.IsEmpty || dialectScopes.Contains(dialect.GetType().FullName);
  50 + return dialectScopes.Count == 0 || dialectScopes.Contains(dialect.GetType().FullName);
51 51 }
52 52
53 53 public abstract string SqlCreateString(Dialect.Dialect dialect, IMapping p, string defaultCatalog, string defaultSchema);
19 src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs
@@ -2,7 +2,8 @@
2 2 using System.Collections;
3 3 using System.Collections.Generic;
4 4 using System.Data;
5   -using System.Data.Common;
  5 +using System.Data.Common;
  6 +using System.Linq;
6 7 using System.Text;
7 8 using NHibernate.AdoNet;
8 9 using NHibernate.Cache;
@@ -620,16 +621,12 @@ private ICollectionInitializer GetSubselectInitializer(object key, ISessionImple
620 621 else
621 622 {
622 623 // Take care of any entities that might have
623   - // been evicted!
624   - List<EntityKey> keysToRemove = new List<EntityKey>(subselect.Result.Count);
625   - foreach (EntityKey entityKey in subselect.Result)
626   - {
627   - if (!persistenceContext.ContainsEntity(entityKey))
628   - {
629   - keysToRemove.Add(entityKey);
630   - }
631   - }
632   - subselect.Result.RemoveAll(keysToRemove);
  624 + // been evicted!
  625 + List<EntityKey> keysToRemove = subselect.Result
  626 + .Where(entityKey => !persistenceContext.ContainsEntity(entityKey)).ToList();
  627 +
  628 + foreach (var entityKey in keysToRemove)
  629 + subselect.Result.Remove(entityKey);
633 630
634 631 // Run a subquery loader
635 632 return CreateSubselectInitializer(subselect, session);

0 comments on commit 7ddce60

Please sign in to comment.
Something went wrong with that request. Please try again.