Esempio n. 1
0
        protected override CollectionHandleBase CreateHandle()
        {
            if (_allRecords)
            {
                return(Realm.MakeResultsForTable(TargetMetadata));
            }

            // do all the LINQ expression evaluation to build a query
            var qv = _provider.MakeVisitor();

            qv.Visit(Expression);
            var queryHandle = qv.CoreQueryHandle; // grab out the built query definition
            var sortHandle  = qv.OptionalSortDescriptorBuilder;

            return(Realm.MakeResultsForQuery(queryHandle, sortHandle));
        }
Esempio n. 2
0
        private ResultsHandle CreateResultsHandle()
        {
            var retType = typeof(T);

            if (_allRecords)
            {
                return(_realm.MakeResultsForTable(retType));
            }
            else
            {
                // do all the LINQ expression evaluation to build a query
                var qv = _provider.MakeVisitor(retType);
                qv.Visit(Expression);
                var queryHandle = qv._coreQueryHandle; // grab out the built query definition
                var sortHandle  = qv._optionalSortOrderHandle;
                return(_realm.MakeResultsForQuery(retType, queryHandle, sortHandle));
            }
        }
Esempio n. 3
0
 internal RealmResults(Realm realm, RealmObject.Metadata metadata, ResultsHandle handle = null)
     : this(realm, metadata, new RealmResultsProvider(realm, metadata), null)
 {
     _handle = handle ?? realm.MakeResultsForTable(metadata);
 }