views:

110

answers:

3

I am a newbie to the Entity Framework. I am trying to generate a model from my database and I get the following errors:

'_Content' is already declared as 'Private _Content As Integer' in this class. 'OnContentChanging' cannot be declared 'Partial' because only one method 'OnContentChanging' can be marked 'Partial'. 'OnContentChanged' cannot be declared 'Partial' because only one method 'OnContentChanged' can be marked 'Partial'.

Does anyone know what could be the cause of this?

+1  A: 

It sounds like it is duplicating the properties... have you perhaps left an abandoned model in the project somewhere? Alternatively, do you have two tables that are so similar that the escaping rules might be making them the same?

Marc Gravell
+1  A: 

The problem was that I had 2 Models in my project. I needed to set the Namespace for one of the models to something else and it worked fine.

bechbd
A: 

I had this problem, but a different situation. I'd been experimenting with Linq to SQL and had generated the Linq to SQL classes. Then I created the ADO .Net Data Model. Found that those two models, although different, are similar enough to clash with this error.

Jeff