{"record":{"id":"90e2e1a18158eebb","repo":"dotnet/efcore","slug":"the-object-name-has-been-removed-from-the-mode-90e2e1","errorCode":null,"errorMessage":"The object '{name}' has been removed from the model.","messagePattern":"The object '(.+?)' has been removed from the model\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Metadata/Internal/RelationalPropertyOverrides.cs","lineNumber":77,"sourceCode":"    ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to\n    ///     the same compatibility standards as public APIs. It may be changed or removed without notice in\n    ///     any release. You should only use it directly in your code with extreme caution and knowing that\n    ///     doing so can result in application failures when updating to a new Entity Framework Core release.\n    /// </summary>\n    public override bool IsReadOnly\n        => ((Annotatable)Property).IsReadOnly;\n\n    /// <summary>\n    ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to\n    ///     the same compatibility standards as public APIs. It may be changed or removed without notice in\n    ///     any release. You should only use it directly in your code with extreme caution and knowing that\n    ///     doing so can result in application failures when updating to a new Entity Framework Core release.\n    /// </summary>\n    public virtual InternalRelationalPropertyOverridesBuilder Builder\n    {\n        [DebuggerStepThrough]\n        get => _builder\n            ?? throw new InvalidOperationException(\n                CoreStrings.ObjectRemovedFromModel(\n                    $\"{Property.Name} - {StoreObject.DisplayName()}\"));\n    }\n\n    /// <summary>\n    ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to\n    ///     the same compatibility standards as public APIs. It may be changed or removed without notice in\n    ///     any release. You should only use it directly in your code with extreme caution and knowing that\n    ///     doing so can result in application failures when updating to a new Entity Framework Core release.\n    /// </summary>\n    public virtual bool IsInModel\n        => _builder is not null\n            && ((IConventionAnnotatable)Property).IsInModel;\n\n    /// <summary>\n    ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to\n    ///     the same compatibility standards as public APIs. It may be changed or removed without notice in\n    ///     any release. You should only use it directly in your code with extreme caution and knowing that","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Relational/Metadata/Internal/RelationalPropertyOverrides.cs#L59-L95","documentation":"Thrown when accessing the Builder of an InternalRelationalPropertyOverrides instance after it (or its property) has been removed from the model. Once removed, the overrides object holds a null _builder and the Builder getter refuses to return it.","triggerScenarios":"InternalRelationalPropertyOverridesBuilder.Builder get when _builder is null. Triggered by holding a reference to an overrides builder obtained before the property/overrides were removed (e.g. via Ignore, RemoveProperty, or clearing relational overrides), then later touching its Builder.","commonSituations":"Long-lived conventions or model customizers caching an overrides builder across mutation steps; calling configuration code twice where the second call runs after the property was ignored; model caching where a stale builder reference survives a model rebuild.","solutions":["Check IsInModel before accessing Builder.","Do not cache overrides builders across model mutations; re-fetch them each time.","Ensure the property is still mapped (not Ignored) before reconfiguring its overrides.","Rebuild the model fresh instead of reusing removed metadata objects."],"exampleFix":"// before\nvar overridesBuilder = propertyBuilder.Metadata.GetOverrides(storeObject);\n// ... later, after the property is ignored\noverridesBuilder.Builder.Property.HasColumn(...); // throws\n\n// after\nif (overridesBuilder.IsInModel)\n{\n    overridesBuilder.Builder.Property.HasColumn(...);\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Guard before touching the overrides builder.\nstatic bool OverridesAreLive(InternalRelationalPropertyOverrides overrides)\n    => overrides is { IsInModel: true };","tryCatchPattern":null,"preventionTips":["Check IsInModel before accessing Builder on any internal overrides object.","Never cache overrides builders across model mutations.","Re-fetch metadata objects after Ignore/Remove operations.","Prefer the convention API over direct internal-builder use."],"tags":["ef-core","relational-metadata","property-overrides","object-lifecycle","internal-api"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}