Example #1
0
        public ResultsHandle CreateResults(SharedRealmHandle sharedRealm, SortDescriptorHandle sortDescriptor)
        {
            var result = NativeMethods.create_results(this, sharedRealm, sortDescriptor, out var nativeException);

            nativeException.ThrowIfNecessary();
            return(new ResultsHandle(sharedRealm, result));
        }
Example #2
0
        // strange as it may seem, this is also called for the LHS when simply iterating All<T>()
        protected override Expression VisitConstant(ConstantExpression node)
        {
            if (node.Value is IQueryableCollection results)
            {
                // assume constant nodes w/ IQueryables are table references
                if (_coreQueryHandle != null)
                {
                    throw new Exception("We already have a table...");
                }

                _coreQueryHandle = results.GetQuery();
                _sortDescriptor  = results.GetSortDescriptor();
            }
            else if (node.Value?.GetType() == typeof(object))
            {
                throw new NotSupportedException($"The constant for '{node.Value}' is not supported");
            }

            return(node);
        }
Example #3
0
 public static extern IntPtr create_results(QueryHandle queryPtr, SharedRealmHandle sharedRealm, SortDescriptorHandle sortDescriptor, out NativeException ex);
Example #4
0
 public static extern void add_clause(SortDescriptorHandle descriptor, TableHandle query, SharedRealmHandle realm,
                                      [MarshalAs(UnmanagedType.LPArray), In] IntPtr[] property_index_chain, IntPtr column_keys_count,
                                      [MarshalAs(UnmanagedType.U1)] bool ascending,
                                      out NativeException ex);