c# - Entity Framework - Using Navigation Properties over Joins -


i'm working entity framework on legacy database no relationships. our queries written linq joins.

are there advantages (and maybe disadvantages) adding associations in model , writing our queries navigation properties? had no luck far finding straightforward answer question , want know if it's worth effort.

i believe there no benefit performance wise if query generated navigation properties similar join query.

i listed believe pros , cons of navigation properties compared joins:

pro

  • queries lot shorter , more readable because mappings of keys hidden
  • object relationships automatically provided
  • results hierarchical , not flattened

con

actually, you've answered question. of course, queries using navigation properties more convenient, queries joins.

concerning includes - overusing of include analogue of overusing of join, because include @ least join and, optionally, else. not write queries tens of include calls, , there won't performance hit.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -