Simple question really. As part of some data structure changes that I’ve been making, I’ve moved the mapping of one of our Entity Framework sets from a View to a Database table. To get this working quickly and ensure proof of concept I just changed the name of the DB Table to match the expected Entity Set Name and then made my other changes. Changing the actual name of the Entity Set caused a ripple of mismatches (and thus errors) through the code.
This worked fine and I’m happy with the new code. However ideally I’d prefer to be able to change the mapping rather than the name of the table on our live servers. Is it possible to make an Entity Set map to a table without having the name of the Set match the name of the DB table?
Cheers,
Matt
Yes. You can edit the data model XML directly. Or, in the designer, you can edit the name of entity set using the Properties window and you can edit the mapping using the Mapping Details window. In the Mapping Details window, just select the table to map to, then map the columns to the properties.