Example #1
0
        /// <summary>
        /// Returns the same query as the one referenced when the <see cref="ThreadSafeReference.Query{T}"/> was first created,
        /// but resolved for the current Realm for this thread.
        /// </summary>
        /// <param name="reference">The thread-safe reference to the thread-confined <see cref="IQueryable{T}"/> to resolve in this <see cref="Realm"/>.</param>
        /// <typeparam name="T">The type of the object, contained in the query.</typeparam>
        /// <returns>A thread-confined instance of the original <see cref="IQueryable{T}"/> resolved for the current thread.</returns>
        public IQueryable <T> ResolveReference <T>(ThreadSafeReference.Query <T> reference) where T : RealmObject
        {
            var resultsPtr    = SharedRealmHandle.ResolveReference(reference);
            var resultsHandle = new ResultsHandle(SharedRealmHandle, resultsPtr);

            return(new RealmResults <T>(this, reference.Metadata, resultsHandle));
        }
Example #2
0
 /// <summary>
 /// Returns the same query as the one referenced when the <see cref="ThreadSafeReference.Query{T}"/> was first created,
 /// but resolved for the current Realm for this thread.
 /// </summary>
 /// <param name="reference">The thread-safe reference to the thread-confined <see cref="IQueryable{T}"/> to resolve in this <see cref="Realm"/>.</param>
 /// <typeparam name="T">The type of the object, contained in the query.</typeparam>
 /// <returns>A thread-confined instance of the original <see cref="IQueryable{T}"/> resolved for the current thread.</returns>
 public IQueryable <T> ResolveReference <T>(ThreadSafeReference.Query <T> reference) where T : RealmObject
 {
     RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
     return(null);
 }