

Managing DbContext the right way with Entity Framework 6: an in-depth guide - Rapzid
http://mehdi.me/ambient-dbcontext-in-ef6/

======
Rapzid
This is a really great guide to db context pitfalls. Entity Framework has a
lot of really awesome features. It's object tracking is akin to React's
virtual DOM(in a way) and the way unit of work is rolled for you is super
handy. Unfortunately it's also quite massive and you might end up all over the
internet searching for how to do something the best way. Idiomatic EF is hard
to locate, if it even exists. One of those difficulties is when to use proxy
objects and when/where to create your db context. If you don't utilize the
same context within your "unit of work" you'll end up with errors about the
connection being closed(for lazing loading) or that your object can't be
tracked in multiple trackers.

I'm hoping to try out the project linked to from this guide to help with
better utilizing the context in a clean fashion.

Now if I can just find a better way to handle createdAt/updatedAt time stamps,
validation, and other things usually handled in life cycle hooks I'll be a
happy camper:)

