Skip to content

Document high-level model building concepts #779

Closed

Description

@ajcvickers

Such as:

  • Fluent over Attribute over Convention precedence for mapping
  • Last-one-wins in Code First

Activity

  1. added this to the 2.2.0 milestone on Jun 20, 2018
  2. modified the milestones: 2.2.0, 3.0.0 on Feb 21, 2019
  3. AndriySvyryd commented on Aug 12, 2019

    @AndriySvyryd
    Member
    • If a metadata property/navigation name matches a CLR member it must be using it (can't be shadow).
    • IModel vs IMutableModel vs IConventionModel vs ModelBuilder vs IConventionModelBuilder
    • Show how to print out the Debug view of the model before and after model validation.
    • ConventionBuilders throwing for invalid configuration and returning null for overriden configuration
    • Metadata API have no side effects (apart from conventions), ConventionBuilders will try to make the adjustments to make the configuration valid, but will offload as much as possible to the conventions
  4. modified the milestones: 3.0.0, Backlog on Aug 28, 2019
  5. removed their assignment
    on Sep 18, 2019
  6. AndriySvyryd commented on Jul 3, 2020

    @AndriySvyryd
    Member

    Why should we use conventions instead of hardcoding the configuration in builders

    Pros

    • Composability. The logic contained in a convention doesn't directly depend on logic in other conventions. This makes them easier to test and resilient to code churn.
    • Extensibility. Conventions can be added, removed, replaced and reordered by providers and (soon) by users
    • Efficiency. By separating the configuration change event from the code that processes it we can avoid unnecessary calls. (E,g, if a property is removed before the added event is processed then neither event needs to be processed).
    • Maintainability. Having the code separated into files by functionality makes it easier to find and understand than having it spread out through builders that are separated hierarchically.

    Cons

    • They add overhead and will be slower in many cases.
    • Authoring them requires better understanding of how model building works
  7. added a commit that references this issue on Nov 12, 2022
    3e16275
  8. added 2 commits that reference this issue on Nov 30, 2022
    a8e088f
    15fb84b
  9. modified the milestones: Backlog, 7.0.0 on Nov 30, 2022
  10. added a commit that references this issue on Nov 30, 2022
    3e14402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions