Simplifying creation of inherited classes
Basically we need to fetch Entity from the database and then map it into A or B depending on a field.
That means you'll have to repeat the field copies a lot. With more fields and more "A"-"B"-"C"-"D"s... this will become a nightmare to maintain. Any other ideas?
2 Replies
I guess the only solution is to use an automatic mapper or just copy the fields over and over again 🥲
Are you using an ORM?
EF Core should be able to handle this with discriminators