private INakedObjectAdapter Page(INakedObjectAdapter objectRepresentingCollection, int page, int size, bool forceEnumerable)
        {
            var toEnumerable = IsNotQueryable(objectRepresentingCollection) || forceEnumerable;

            var newNakedObject = objectRepresentingCollection.GetCollectionFacetFromSpec().Page(page, size, objectRepresentingCollection, framework.NakedObjectManager, toEnumerable);

            object[] objects = newNakedObject.GetAsEnumerable(framework.NakedObjectManager).Select(no => no.Object).ToArray();

            var currentMemento            = (ICollectionMemento)WrappedNakedObject.Oid;
            ICollectionMemento newMemento = currentMemento.NewSelectionMemento(objects, true);

            newNakedObject.SetATransientOid(newMemento);
            return(newNakedObject);
        }
 private static INakedObjectAdapter RestoreCollection(ICollectionMemento memento)
 {
     return(memento.RecoverCollection());
 }
 private static INakedObjectAdapter RestoreCollection(ICollectionMemento memento) => memento.RecoverCollection();
 private static INakedObjectAdapter RestoreCollection(ICollectionMemento memento) {
     return memento.RecoverCollection();
 }
        private static bool IsNotQueryable(INakedObjectAdapter objectRepresentingCollection)
        {
            ICollectionMemento collectionMemento = objectRepresentingCollection.Oid as ICollectionMemento;

            return(collectionMemento != null && collectionMemento.IsNotQueryable);
        }