diff --git a/Tools/packages.csproj b/Tools/packages.csproj index 23590a90970..2de5cb6eed4 100644 --- a/Tools/packages.csproj +++ b/Tools/packages.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NHibernate/Async/Collection/Generic/PersistentGenericBag.cs b/src/NHibernate/Async/Collection/Generic/PersistentGenericBag.cs index de777215a65..9707d1dbefa 100644 --- a/src/NHibernate/Async/Collection/Generic/PersistentGenericBag.cs +++ b/src/NHibernate/Async/Collection/Generic/PersistentGenericBag.cs @@ -77,17 +77,7 @@ public override Task GetDeletesAsync(ICollectionPersister persister } //Since 5.3 - /// - /// Get all "orphaned" elements - /// - /// The snapshot of the collection. - /// The persistent class whose objects - /// the collection is expected to contain. - /// A cancellation token that can be used to cancel the work - /// - /// An that contains all of the elements - /// that have been orphaned. - /// + /// [Obsolete("This method has no more usages and will be removed in a future version")] public override Task GetOrphansAsync(object snapshot, string entityName, CancellationToken cancellationToken) { @@ -97,8 +87,7 @@ public override Task GetOrphansAsync(object snapshot, string entity } try { - var sn = (ICollection) snapshot; - return Task.FromResult(GetOrphans(sn, (ICollection) _gbag, entityName, Session)); + return Task.FromResult(GetOrphans(snapshot, entityName)); } catch (Exception ex) { diff --git a/src/NHibernate/Async/Collection/Generic/PersistentGenericIdentifierBag.cs b/src/NHibernate/Async/Collection/Generic/PersistentGenericIdentifierBag.cs index 7250c95ad55..6e3ea111d01 100644 --- a/src/NHibernate/Async/Collection/Generic/PersistentGenericIdentifierBag.cs +++ b/src/NHibernate/Async/Collection/Generic/PersistentGenericIdentifierBag.cs @@ -157,17 +157,7 @@ public override async Task ReadFromAsync(DbDataReader reader, ICollectio } //Since 5.3 - /// - /// Get all "orphaned" elements - /// - /// The snapshot of the collection. - /// The persistent class whose objects - /// the collection is expected to contain. - /// A cancellation token that can be used to cancel the work - /// - /// An that contains all of the elements - /// that have been orphaned. - /// + /// [Obsolete("This method has no more usages and will be removed in a future version")] public override Task GetOrphansAsync(object snapshot, string entityName, CancellationToken cancellationToken) { @@ -177,8 +167,7 @@ public override Task GetOrphansAsync(object snapshot, string entity } try { - var sn = (ISet)GetSnapshot(); - return Task.FromResult(GetOrphans(sn.ToArray(x => x.Value), (ICollection) _values, entityName, Session)); + return Task.FromResult(GetOrphans(snapshot, entityName)); } catch (Exception ex) { diff --git a/src/NHibernate/Async/Collection/Generic/PersistentGenericList.cs b/src/NHibernate/Async/Collection/Generic/PersistentGenericList.cs index 1a1fe094e62..6b6e8126ffb 100644 --- a/src/NHibernate/Async/Collection/Generic/PersistentGenericList.cs +++ b/src/NHibernate/Async/Collection/Generic/PersistentGenericList.cs @@ -31,17 +31,7 @@ public partial class PersistentGenericList : AbstractPersistentCollection, IL { //Since 5.3 - /// - /// Get all "orphaned" elements - /// - /// The snapshot of the collection. - /// The persistent class whose objects - /// the collection is expected to contain. - /// A cancellation token that can be used to cancel the work - /// - /// An that contains all of the elements - /// that have been orphaned. - /// + /// [Obsolete("This method has no more usages and will be removed in a future version")] public override Task GetOrphansAsync(object snapshot, string entityName, CancellationToken cancellationToken) { @@ -51,8 +41,7 @@ public override Task GetOrphansAsync(object snapshot, string entity } try { - var sn = (IList)snapshot; - return Task.FromResult(GetOrphans((ICollection)sn, (ICollection) WrappedList, entityName, Session)); + return Task.FromResult(GetOrphans(snapshot, entityName)); } catch (Exception ex) { diff --git a/src/NHibernate/Async/Collection/Generic/PersistentGenericMap.cs b/src/NHibernate/Async/Collection/Generic/PersistentGenericMap.cs index 567046ef15e..ccba8292fe4 100644 --- a/src/NHibernate/Async/Collection/Generic/PersistentGenericMap.cs +++ b/src/NHibernate/Async/Collection/Generic/PersistentGenericMap.cs @@ -31,17 +31,7 @@ public partial class PersistentGenericMap : AbstractPersistentColl { //Since 5.3 - /// - /// Get all "orphaned" elements - /// - /// The snapshot of the collection. - /// The persistent class whose objects - /// the collection is expected to contain. - /// A cancellation token that can be used to cancel the work - /// - /// An that contains all of the elements - /// that have been orphaned. - /// + /// [Obsolete("This method has no more usages and will be removed in a future version")] public override Task GetOrphansAsync(object snapshot, string entityName, CancellationToken cancellationToken) { @@ -51,8 +41,7 @@ public override Task GetOrphansAsync(object snapshot, string entity } try { - var sn = (IDictionary) snapshot; - return Task.FromResult(GetOrphans((ICollection)sn.Values, (ICollection)WrappedMap.Values, entityName, Session)); + return Task.FromResult(GetOrphans(snapshot, entityName)); } catch (Exception ex) { diff --git a/src/NHibernate/Async/Collection/Generic/PersistentGenericSet.cs b/src/NHibernate/Async/Collection/Generic/PersistentGenericSet.cs index d28409ada26..e608a2ffae2 100644 --- a/src/NHibernate/Async/Collection/Generic/PersistentGenericSet.cs +++ b/src/NHibernate/Async/Collection/Generic/PersistentGenericSet.cs @@ -32,17 +32,7 @@ public partial class PersistentGenericSet : AbstractPersistentCollection, ISe { //Since 5.3 - /// - /// Get all "orphaned" elements - /// - /// The snapshot of the collection. - /// The persistent class whose objects - /// the collection is expected to contain. - /// A cancellation token that can be used to cancel the work - /// - /// An that contains all of the elements - /// that have been orphaned. - /// + /// [Obsolete("This method has no more usages and will be removed in a future version")] public override Task GetOrphansAsync(object snapshot, string entityName, CancellationToken cancellationToken) { @@ -52,12 +42,7 @@ public override Task GetOrphansAsync(object snapshot, string entity } try { - var sn = new SetSnapShot((IEnumerable)snapshot); - - // TODO: Avoid duplicating shortcuts and array copy, by making base class GetOrphans() more flexible - if (WrappedSet.Count == 0) return Task.FromResult(sn); - if (((ICollection)sn).Count == 0) return Task.FromResult(sn); - return Task.FromResult(GetOrphans(sn, WrappedSet.ToArray(), entityName, Session)); + return Task.FromResult(GetOrphans(snapshot, entityName)); } catch (Exception ex) { diff --git a/src/NHibernate/Async/Collection/PersistentArrayHolder.cs b/src/NHibernate/Async/Collection/PersistentArrayHolder.cs index 3a1353ab348..448309f2f9e 100644 --- a/src/NHibernate/Async/Collection/PersistentArrayHolder.cs +++ b/src/NHibernate/Async/Collection/PersistentArrayHolder.cs @@ -28,17 +28,7 @@ public partial class PersistentArrayHolder : AbstractPersistentCollection, IColl { //Since 5.3 - /// - /// Get all "orphaned" elements - /// - /// The snapshot of the collection. - /// The persistent class whose objects - /// the collection is expected to contain. - /// A cancellation token that can be used to cancel the work - /// - /// An that contains all of the elements - /// that have been orphaned. - /// + /// [Obsolete("This method has no more usages and will be removed in a future version")] public override Task GetOrphansAsync(object snapshot, string entityName, CancellationToken cancellationToken) { @@ -48,7 +38,7 @@ public override Task GetOrphansAsync(object snapshot, string entity } try { - return Task.FromResult(GetOrphans((object[]) snapshot, (object[]) array, entityName, Session)); + return Task.FromResult(GetOrphans(snapshot, entityName)); } catch (Exception ex) { diff --git a/src/NHibernate/Async/Impl/AbstractQueryImpl2.cs b/src/NHibernate/Async/Impl/AbstractQueryImpl2.cs index 00fad92ccd3..f61abfe4c17 100644 --- a/src/NHibernate/Async/Impl/AbstractQueryImpl2.cs +++ b/src/NHibernate/Async/Impl/AbstractQueryImpl2.cs @@ -119,6 +119,7 @@ public abstract partial class AbstractQueryImpl2 : AbstractQueryImpl } // Since v5.2 + /// [Obsolete("This method has no usages and will be removed in a future version")] protected internal override Task> GetTranslatorsAsync(ISessionImplementor sessionImplementor, QueryParameters queryParameters, CancellationToken cancellationToken) { diff --git a/src/NHibernate/Async/Impl/CollectionFilterImpl.cs b/src/NHibernate/Async/Impl/CollectionFilterImpl.cs index 46a53d0219a..af6b061848e 100644 --- a/src/NHibernate/Async/Impl/CollectionFilterImpl.cs +++ b/src/NHibernate/Async/Impl/CollectionFilterImpl.cs @@ -61,6 +61,7 @@ public partial class CollectionFilterImpl : QueryImpl } // Since v5.2 + /// [Obsolete("This method has no usages and will be removed in a future version")] protected internal override Task> GetTranslatorsAsync(ISessionImplementor session, QueryParameters queryParameters, CancellationToken cancellationToken) { diff --git a/src/NHibernate/Async/Impl/ExpressionQueryImpl.cs b/src/NHibernate/Async/Impl/ExpressionQueryImpl.cs index a473450df66..d98e200c5e9 100644 --- a/src/NHibernate/Async/Impl/ExpressionQueryImpl.cs +++ b/src/NHibernate/Async/Impl/ExpressionQueryImpl.cs @@ -81,6 +81,7 @@ internal partial class ExpressionFilterImpl : ExpressionQueryImpl } // Since v5.2 + /// [Obsolete("This method has no usages and will be removed in a future version")] protected internal override Task> GetTranslatorsAsync(ISessionImplementor session, QueryParameters queryParameters, CancellationToken cancellationToken) { diff --git a/src/NHibernate/Async/Impl/SqlQueryImpl.cs b/src/NHibernate/Async/Impl/SqlQueryImpl.cs index 31b2edb0dc7..ec46826430a 100644 --- a/src/NHibernate/Async/Impl/SqlQueryImpl.cs +++ b/src/NHibernate/Async/Impl/SqlQueryImpl.cs @@ -107,6 +107,7 @@ public partial class SqlQueryImpl : AbstractQueryImpl, ISQLQuery, ISynchronizabl } // Since v5.2 + /// [Obsolete("This method has no usages and will be removed in a future version")] protected internal override Task> GetTranslatorsAsync(ISessionImplementor sessionImplementor, QueryParameters queryParameters, CancellationToken cancellationToken) {