Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 308
Mostafa Avatar asked Jul 18 '26 13:07

Mostafa


1 Answers

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.

like image 134
Mashton Avatar answered Jul 20 '26 03:07

Mashton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!