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)); }
// 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); }
public static extern IntPtr create_results(QueryHandle queryPtr, SharedRealmHandle sharedRealm, SortDescriptorHandle sortDescriptor, out NativeException ex);
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);