0
votes

Does anyone know why this error occurs?

'Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.'

I am getting this error when I am trying to update a bool value in my database. Please see the picture for get clear idea.

pic

1
Check the inner exception - Shyju
Do check your models. You are not fulfilling all the requirements on your models and this is what creates the error. For example, you may have a required email but in your posted data, there was no email or maybe the name input shouldn't be less than 20 but you have one that is less than that so do check your model attributes or mapping configuration. - Alf Moh

1 Answers

2
votes

Following code solve my issue. Thanks for all comments

db.Configuration.ValidateOnSaveEnabled = false;