Skip to content

Consider moving log messages/warnings for requiredness of navigation properties to model validation #15539

@divega

Description

@divega

We currently log messages or warning for some conditions while executing conventions (see discussion in #15499). For example:

  • If we switch principal-dependent ends because we find [Required] or non-nullable on a navigation,
  • If [Required] or non-nullability appears on navigations on both sides of a relationship

However the checks are limited to metadata that the conventions reason about and fail to detect some ambiguous scenarios, e.g.:

  • The convention detects [Required] (or non-nullability) on a navigation and makes the target of the navigation the principal, but that principal contains a good FK candidate property
  • The convention detects [Required] (or non-nullability) on a navigation that is later made to point to the dependent via explicit configuration

Discussing this with @AndriySvyryd and @smitpatel one of the conclusions was if we postpone the analysis to model validation we could implement more robust detection of ambiguous configurations.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions