Mostafa
Mostafa

Reputation: 111

Entity framework error (a partial method may not have multiple defining declarations)

I have a project with entity framework and vs 2010 . This project was not until yesterday no problem but today when update model I encountered an error .

for example (170 error like this) :

error : A partial method may not have multiple defining declarations

error : The type 'taban.user' already contains a definition for 'QualityPart'

I've removed and re-built as a model.edmx but still encountered an error

Upvotes: 3

Views: 2278

Answers (1)

Mashton
Mashton

Reputation: 6415

Make sure you only have one designer generated file for your context. Did you move the original?

When you updated the model a new one will have been generated (*if it couldn't find the original), and the result is it looks like you are defining the partial classes in two places with identical methods. Do a search through your solution for files that define the context.

Upvotes: 2

Related Questions