Base solution for your next web application
Open Closed

Entity Relationship - Navigaton properties vs Repository #1526


User avatar
0
cicciottino created

What is the best way to manage relationship on abp? Using Navigation Properties on an entity or having single repositories to load single collection of entities? Does the repository pattern discourage the use of navigation properties?


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Does the repository pattern discourage the use of navigation properties?

    Definetely no. You can use navigation properties when needed. But if you want to follow best practices and DDD, you can check Aggregate pattern rules (search web for details). I suggest you to keep navigation properties minimal and use them if two entities are commonly used together and they may be part of an aggregate. Adding a navigation property makes two entities tightly coupled. So, it depends on your design (single module or multiple module for example)