I am using Entity Framework version 4.0 to create a model using the database first approach. In the database, there's a number of tables that contain columns named the same as their parent table.
So for example we have
The issue is that when one of these tables is imported into the EF model, the property names that those columns get mapped to get a '1' appended to the end of them.
So I end up with
When I attempt to remove the '1' at the end, I get a message saying "The name Status cannot be duplicated in this context. Please choose another name."
Is there a way for me to have my properties keep their names or is this a documented limitation in the framework?
You can't have a member in your class which is named like your class is.
Example:
class Test
{
// Invalid
int Test;
// Invalid
public int Test {get; set; }
// OK
int Test1;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With