{"record":{"id":"be1dc0f7174c0d34","repo":"dotnet/reactive","slug":"the-method-or-operation-is-not-implemented","errorCode":null,"errorMessage":"The method or operation is not implemented.","messagePattern":"The method or operation is not implemented\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/ObservableQuery.cs","lineNumber":84,"sourceCode":"                        arg0\n                    )\n                );\n\n            //\n            // Queryable operator calls should be taken care of by the provider for\n            // LINQ to Objects. So we compile and get the resulting IQueryable<T>\n            // back to hand it out.\n            //\n            return Expression.Lambda<Func<IQueryable<TElement>>>(res).Compile()();\n        }\n\n        private static MethodInfo? _staticAsQueryable;\n\n        private static MethodInfo AsQueryable => _staticAsQueryable ??=  Qbservable.InfoOf<object>(() => Queryable.AsQueryable<object>(null!)).GetGenericMethodDefinition();\n\n        IQueryable IQueryProvider.CreateQuery(Expression expression)\n        {\n            throw new NotImplementedException();\n        }\n\n        TResult IQueryProvider.Execute<TResult>(Expression expression)\n        {\n            throw new NotImplementedException();\n        }\n\n        object IQueryProvider.Execute(Expression expression)\n        {\n            throw new NotImplementedException();\n        }\n    }\n\n#if HAS_TRIMMABILITY_ATTRIBUTES\n    [RequiresUnreferencedCode(Constants_Core.AsQueryableTrimIncompatibilityMessage)]\n#endif\n    internal class ObservableQuery\n    {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/ObservableQuery.cs#L66-L102","documentation":"The non-generic IQueryProvider.CreateQuery(Expression) overload of the ObservableQuery provider is deliberately unimplemented — the bridge only supports the generic CreateQuery<T> path used by ToQueryable. Calling the non-generic overload always throws NotImplementedException.","triggerScenarios":"Calling IQueryProvider.CreateQuery (non-generic) on the ObservableQuery provider, e.g. via late-bound reflection code or non-generic IQueryable usage patterns.","commonSituations":"Framework code that resolves the provider through the non-generic IQueryable interface, data-binding or LINQ infrastructure that only has an Expression and no compile-time T.","solutions":["Use the generic IQueryProvider.CreateQuery<T>(Expression) path instead (via ToQueryable<T>)","Cast the queryable to its typed IQueryable<T> interface before creating queries","Wrap the call and surface a clearer error explaining only the generic provider API is supported"],"exampleFix":"// before\nIQueryable q = ((IQueryProvider)provider).CreateQuery(expression);\n// after\nIQueryable<T> q = ((IQueryProvider)provider).CreateQuery<T>(expression);","handlingStrategy":"try-catch","validationCode":"var typed = queryable as IQueryable<T>; if (typed == null) throw new NotSupportedException(\"Use the generic CreateQuery<T> path\");","typeGuard":"static bool SupportsGenericCreateQuery(IQueryProvider p) => p is IQueryProvider && typeof(IQueryable<>).IsAssignableFrom(p.GetType());","tryCatchPattern":"try { return provider.CreateQuery(expression); } catch (NotImplementedException) { throw new NotSupportedException(\"Non-generic CreateQuery is not supported by the ObservableQuery bridge; use CreateQuery<T>.\"); }","preventionTips":["Always work with the typed IQueryable<T> interface","Avoid reflection/late-binding paths that resolve the non-generic provider API","Prefer consuming IQbservable directly instead of the bridge"],"tags":["not-implemented","linq","rx","iqqueryable"],"backgroundTag":"method-not-implemented","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}