Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any setting to convert null strings to empty automatical
Message
 
 
À
30/09/2014 17:47:45
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:
01608593
Vues:
19
What is fwk?

The application is quite complex (with many complex layers) and I fixed several forms so far (hopefully all of them).

We would need to find a generic solution for the problem, but it doesn't seem to be an easy one. E.g. it's easy to theorize as you do but hard to implement an actual solution.


>>>>1. In our database we have columns which do not allow null values (all data types except dates are not-nullable in our database).
>>>>
>>>>3. When we add a new row in our form, the string values are NULL unless we put values into them.
>>>
>>>For me as a rule of thumb such a rule falls under the data dictionary rules needing to be elevated into the GUI automatically, as in providing a blank string as default value for new rows
>>
>>In the database we do have default values for the columns. However, the INSERT statement already comes with NULLs in them and so far there is nothing that can be done.
>
>Totally in synch with my thinking. That is the reason I wrote "elevate". Our vfp fwk reads database rules like "must not be empty", default values and so on and elevates them to biz layer and sometimes GUI automatically. In my view on how a fwk should operate is that your object layer should better duplicate the behaviour needed in the DB and not create null values in fields/properties which are to be mapped into non-nullable DB fields/columns
>>
>>In one particular case I traced it to creation of the new ViewModel instance (and therefore all strings by default are created as nulls). So, there can be nothing to convert them back to empty strings unless I fix the ViewModel (which I am plan to do). That was the reason for my recent question although I think I'll go with the known approach with using private extra property (unless someone replies soon with a shorter version suggestion).
>
>sounds like bad patching up afterwards instead of fixing the fwk to me, but I have no idea how complex such a fix in your fwk would be.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform