Information générale
Catégorie:
Entity Framework
Versions des environnements
Network:
Windows 2003 Server
>>Isn't that MVC code? I'm not sure of my ground here but that should give empty strings in the EF model - but EF will still try to convert the empty string to null when pushing to the DB unless told otherwise.
>>
>I am not sure I understand you. I just know that this code seems to make no difference and the error remained. I was looking into the getter for the property, but I don't know if I should be doing it or should I let my colleague to handle the issue.
>
>Hopefully we'll figure this out today in the daily standup meeting.
As I understand it the code you posted controls how the model is updated from the HTML - so you should be sure of having empty strings and not null at that point. But you still need to use ConvertEmptyStringsToNull(false) to prevent EF converting those empty strings back to null on the DB.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement