Expona
Context-trained AI agent delivering noise-free, cost-efficient conversational intelligence
Challenge Recently I started working on a new project, with a few other team members. This project involves a really good amount of ERD, means there are a bunch of entities involved in the Database, with a lot of relationships in-between.
I am personally very fond of working with ORMs and familiar with Entity Framework 4.1 and nHibernate which was an obvious choice here but other people involved in this project suggested not to use this as they had some bad experiences with “Entity Framework”.
I guess you might have come across same situation like this. So I thought to write down my own ORM using T4, Which was absolutely not the right choice as per the tight deadlines.
So I thought of another solution which involves writing a base manager class which will serve the same purpose.
Features
Solution
Here is a snap of my base manager class.

Here is how fast and easy to create your manager class. No method required for basic database operations.

If you have complex Entity which has a complex or Navigation properties with different kind of relationship in between, You can specify relationship by “ChildEntityInfo” object. In this case Manager class would look like below code.

Now you can use manager class as a normal manager class. Like below

Conclusion
This obviously isn’t the best solution to this case, and obviously isn’t something ground-breaking either. I just tried a simple solution that helps a lot when it comes to trying to deal with such circumstances. Hope this will be helpful for others as well.