{"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/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Metadata/Builders/OwnedNavigationStoredProcedureBuilder.cs#L123-L159","documentation":"Thrown by OwnedNavigationStoredProcedureBuilder.CreatePropertyBuilder(string) at OwnedNavigationStoredProcedureBuilder.cs:140-141 when FindProperty(propertyName) returns null on the owned entity type. This happens when configuring a stored procedure mapping for an owned navigation and referencing a property name that does not exist on the owned entity's CLR type or model.","triggerScenarios":"Calling stored procedure mapping methods like HasParameter(\"PropertyName\") or result column configuration on an owned navigation's stored procedure builder with a string name that doesn't match any property declared on the owned entity type.","commonSituations":"Typo in the property name string. Referencing a property that exists on the owner rather than the owned entity. The property was renamed but the stored procedure mapping string wasn't updated. The property is shadow and wasn't declared before use.","solutions":["Verify the property name matches a declared property on the owned entity type exactly (case-sensitive).","Declare the shadow property first via .Property<T>(\"Name\") before referencing it in the stored procedure.","Use the strongly-typed lambda overload instead of the string overload to get compile-time checking."],"exampleFix":"// before: typo or wrong entity\nmodelBuilder.Entity<Order>()\n    .OwnsOne(o => o.Details, ob =>\n    {\n        ob.UpdateUsingStoredProcedure(sp => sp.HasParameter(\"Quantitiy\")); // typo\n    });\n\n// after: correct name\nmodelBuilder.Entity<Order>()\n    .OwnsOne(o => o.Details, ob =>\n    {\n        ob.UpdateUsingStoredProcedure(sp => sp.HasParameter(\"Quantity\"));\n    });","handlingStrategy":"type-guard","validationCode":"var entityType = ownedNavigationBuilder.OwnedEntityType;\nif (entityType.FindProperty(propertyName) == null)\n    throw new ArgumentException($\"Property '{propertyName}' not found on {entityType.DisplayName()}.\");\n// safe to proceed with stored procedure mapping","typeGuard":"// Use lambda overloads for compile-time safety\nvoid ConfigureSproc<TDependent, TProp>(OwnedNavigationStoredProcedureBuilder<TDependent> sp, Expression<Func<TDependent, TProp>> prop)\n    where TDependent : class\n{\n    // compiler verifies the property exists\n}","tryCatchPattern":null,"preventionTips":["Prefer lambda-based overloads (HasParameter(x => x.MyProp)) over string-based overloads to catch typos at compile time.","For string-based APIs, validate with FindProperty before calling.","Keep a unit test that verifies all stored procedure property names against the CLR type properties."],"tags":["stored-procedure","property-not-found","owned-navigation"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}