{"record":{"id":"fa2d6159910ad45f","repo":"dotnet/efcore","slug":"property-property-on-entity-type-entitytype","errorCode":null,"errorMessage":"Property '{property}' on entity type '{entityType}' is mapped without a CLR property. 'UseChangeTrackingProxies' requires all entity types to be public, unsealed, have virtual properties, and have a public or protected constructor. 'UseLazyLoadingProxies' requires only the navigation properties be virtual.","messagePattern":"Property '(.+?)' on entity type '(.+?)' is mapped without a CLR property\\. 'UseChangeTrackingProxies' requires all entity types to be public, unsealed, have virtual properties, and have a public or protected constructor\\. 'UseLazyLoadingProxies' requires only the navigation properties be virtual\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Proxies/Proxies/Internal/ProxyBindingRewriter.cs","lineNumber":86,"sourceCode":"                {\n                    continue;\n                }\n\n                if (clrType.IsSealed)\n                {\n                    throw new InvalidOperationException(ProxiesStrings.ItsASeal(entityType.DisplayName()));\n                }\n\n                foreach (var navigationBase in entityType.GetDeclaredNavigations()\n                             .Concat<IConventionNavigationBase>(entityType.GetDeclaredSkipNavigations()))\n                {\n                    if (!navigationBase.IsShadowProperty())\n                    {\n                        if (_options.UseChangeTrackingProxies)\n                        {\n                            if (navigationBase.PropertyInfo == null)\n                            {\n                                throw new InvalidOperationException(\n                                    ProxiesStrings.FieldProperty(navigationBase.Name, entityType.DisplayName()));\n                            }\n\n                            if (navigationBase.PropertyInfo.SetMethod?.IsReallyVirtual() == false)\n                            {\n                                throw new InvalidOperationException(\n                                    ProxiesStrings.NonVirtualProperty(navigationBase.Name, entityType.DisplayName()));\n                            }\n                        }\n\n                        if (_options.UseLazyLoadingProxies\n                            && navigationBase.LazyLoadingEnabled)\n                        {\n                            if (navigationBase.PropertyInfo == null\n                                || !navigationBase.PropertyInfo.GetMethod!.IsReallyVirtual())\n                            {\n                                if (!_options.IgnoreNonVirtualNavigations\n                                    && navigationBase is not INavigation { ForeignKey.IsOwnership: true })","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Proxies/Proxies/Internal/ProxyBindingRewriter.cs#L68-L104","documentation":"With UseChangeTrackingProxies enabled, a navigation that is not a shadow property but has no PropertyInfo (navigationBase.PropertyInfo == null) throws FieldProperty (ProxyBindingRewriter.cs:84-88). Change-tracking proxies must override the property setter, so a field-only navigation without a CLR property cannot be proxied.","triggerScenarios":"Enabling UseChangeTrackingProxies with a navigation mapped without a CLR property (field-only access or a navigation exposed only via a field/getter).","commonSituations":"Using UsePropertyAccessMode.Field or field-only navigation conventions together with change-tracking proxies.","solutions":["Expose a CLR property (with virtual setter) for the navigation instead of a field-only mapping.","Do not use field-only access mode for navigations when change-tracking proxies are enabled.","Stop using change-tracking proxies if field-only navigation mapping is required."],"exampleFix":"// before\nprivate List<Post> _posts = new();\npublic IEnumerable<Post> Posts => _posts; // field-only, no setter property\n// after\npublic virtual ICollection<Post> Posts { get; set; } = new List<Post>();","handlingStrategy":"validation","validationCode":"// Verify each navigation has a CLR property before enabling change-tracking proxies:\nforeach (var et in modelBuilder.Model.GetEntityTypes())\nforeach (var nav in et.GetNavigations())\n{\n    if (!nav.IsShadowProperty() && nav.PropertyInfo is null)\n        throw new InvalidOperationException($\"{et.Name}.{nav.Name} has no CLR property; cannot use change-tracking proxies.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Expose CLR properties (with virtual setters) for all navigations when using change-tracking proxies.","Avoid field-only navigation mappings with change-tracking proxies.","Audit navigation access modes before enabling proxies."],"tags":["ef-core","proxies","change-tracking-proxies","navigation","model-design"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}