Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any setting to convert null strings to empty automatical
Message
De
30/09/2014 11:24:48
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01608410
Message ID:
01608526
Vues:
30
>>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
Fil
Voir

Click here to load this message in the networking platform