So if you have browsed my profile, you'll see an entire article why I dislike Entity Framework for REST development.
Well, a couple of days ago it did it again! Oh so helpful EF with their navigation properties produced an infinite loop when serializing a complex response, making the pod consume the processor and eventually restarting.
Awesome. Just the kind of help I look for in an ORM. <Insert sarcastic smiley here>
Top comments (5)
Hi @webjose bit more insight into it or the two-line code example. What caught my eye was serializing a complex response. Was it running in a monolith or one of the services in distributed design?
It was a microservice. Class
X
had a collection ofY
, andY
had a navigation property toX
.If X and Y represent tables One Repo One table then I am lost :)...... so my guess is they are complex models constructed out of n number of tables.
Don't get lost. The lesson here for me was: Navigation properties get you in trouble when you least expect them. This EF "feature" has gotten in my way one more time. This is why I'd rather use Dapper because it does not provide things to me that I don't need. Cheers!
Buy one get one free :) I think you know that by now I am staying away from EF as much as possible. Dapper has been my friend since 2016.