Ent Lib null input parameters
I'm using Enterprise Library (Jan 2005) for my Data Access Layer. (VS.NET 2003, C#.NET)
I have a class 'Person' that is my bare bones table class, which corresponds to my table in MS SQL Server 2000. This class has many member variables all with different types (int, DateTime, string etc). I want to be able to pass null values into the database with all my member variables. Currently, the constructor for the class is defaulting dates to 1/1/1 and int values to 0 and strings to "", like a good constructor should. I want these values to initialize to null, so that when I add my parameters for the sproc, if the values are still null, then null will be passed to the database, otherwise the populated value will save to the db. Is there an elegant way to accomplish this, or do I have to initialize all the values to there defaults and then do if..else statements every time I add a parameter (checking to see if the value has been changed, and then if it hasn't changing to System.DBNull).
I have a feeling that Enterpirse Library's command wrapper will handle some of the converson, but my constructor keeps setting default vaules. Is there a way to simply turn off the default values and run with un-initialized member variables? That may be a silly question. Anyway, help on this would really be appreciated. Thanks.
Davin

