{"record":{"id":"1ca4f741a9e033ad","repo":"dotnet/efcore","slug":"the-property-1-entitytype-0-property-could-n","errorCode":null,"errorMessage":"The property '{1_entityType}.{0_property}' could not be found. Ensure that the property exists and has been included in the model.","messagePattern":"The property '(.+?)\\.(.+?)' could not be found\\. Ensure that the property exists and has been included in the model\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Metadata/Builders/OwnedNavigationStoredProcedureBuilder.cs","lineNumber":141,"sourceCode":"    {\n        var parameterBuilder = Builder.HasRowsAffectedParameter(ConfigurationSource.Explicit)!;\n        buildAction(new StoredProcedureParameterBuilder(parameterBuilder, null));\n        return this;\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    [EntityFrameworkInternal]\n    protected virtual PropertyBuilder CreatePropertyBuilder(string propertyName)\n    {\n        var entityType = OwnedNavigationBuilder.OwnedEntityType;\n        var property = entityType.FindProperty(propertyName);\n        return property == null\n            ? throw new InvalidOperationException(CoreStrings.PropertyNotFound(propertyName, entityType.DisplayName()))\n            : OwnedNavigationBuilder.Property(property.ClrType, propertyName);\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    [EntityFrameworkInternal]\n    protected virtual PropertyBuilder CreatePropertyBuilder<TDependentEntity, TProperty>(\n        Expression<Func<TDependentEntity, TProperty>> propertyExpression)\n    {\n        var memberInfo = propertyExpression.GetMemberAccess();\n        return OwnedNavigationBuilder.Property(memberInfo.GetMemberType(), memberInfo.Name);\n    }\n\n    /// <summary>","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Relational/Metadata/Builders/OwnedNavigationStoredProcedureBuilder.cs#L123-L159","documentation":"The internal OwnedNavigationStoredProcedureBuilder.CreatePropertyBuilder looks up a property by name on the owned entity type (entityType.FindProperty). If no property with that name exists, it throws CoreStrings.PropertyNotFound. This fires when a stored-procedure mapping for an owned navigation references a property name that is not part of the owned entity's model.","triggerScenarios":"Configuring an owned navigation's stored procedure (e.g. .HasParameter(\"WrongName\") or a result/column binding) and passing a string property name that does not exist on the owned entity type; renamed or removed properties; typos.","commonSituations":"Renaming a property without updating sproc mapping strings; refactor of owned type; copy-paste of sproc config between entities.","solutions":["Use the exact property name as declared on the owned entity type.","Prefer the strongly-typed lambda overload (CreatePropertyBuilder<T,TProperty>(propertyExpression)) which is compile-checked and avoids string typos.","Confirm the property is actually included in the model (not ignored via .Ignore)."],"exampleFix":"// before\nmodelBuilder.Entity<Customer>()\n    .OwnsOne(c => c.Address, a =>\n    {\n        a.HasData(...);\n        a.UpdateStoredProcedure(\"UpsertAddress\", sp => sp.HasParameter(\"Zip\")); // property is 'ZipCode' -> [453]\n    });\n\n// after\nmodelBuilder.Entity<Customer>()\n    .OwnsOne(c => c.Address, a =>\n    {\n        a.UpdateStoredProcedure(\"UpsertAddress\", sp => sp.HasParameter(a => a.ZipCode));\n    });","handlingStrategy":"type-guard","validationCode":"// Verify the property exists on the owned entity before configuring the sproc.\nvar owned = modelBuilder.Entity<Customer>().OwnsOne(c => c.Address).OwnedEntityType;\nif (owned.FindProperty(\"ZipCode\") is null)\n    throw new ArgumentException(\"Property 'ZipCode' not found on owned type Address.\");","typeGuard":"static bool OwnedTypeHasProperty(IEntityType owned, string name)\n    => owned.FindProperty(name) is not null;","tryCatchPattern":null,"preventionTips":["Prefer lambda-based HasParameter/HasResultColumn overloads for compile-time safety.","Update sproc string mappings whenever a property is renamed.","Build the model in a unit test to surface typos at test time."],"tags":["stored-procedures","owned-types","metadata","builder"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}