G
Guest
I have the following sample class where the property value will come from the
database and in the database the value can be null. I believe this is a
common problem if one wants to design bisuness objects. I have read about the
concepts in many books but no one talks about to solve this problem.
In .Net 2.0 there is a solution, but since this is a common problem, I was
wondering how other have solved it before.
public class SampleClass
{
private string stringProp;
private int intProp;
private DateTime dateProp;
public SampleClass()
{
//
// TODO: Add constructor logic here
//
}
public int IntProp
{
get
{
return intProp;
}
set
{
intProp = value;
}
}
public string StringProp
{
get
{
return stringProp;
}
set
{
stringProp = value;
}
}
public DateTime DateProp
{
get
{
return dateProp;
}
set
{
dateProp = value;
}
}
}
database and in the database the value can be null. I believe this is a
common problem if one wants to design bisuness objects. I have read about the
concepts in many books but no one talks about to solve this problem.
In .Net 2.0 there is a solution, but since this is a common problem, I was
wondering how other have solved it before.
public class SampleClass
{
private string stringProp;
private int intProp;
private DateTime dateProp;
public SampleClass()
{
//
// TODO: Add constructor logic here
//
}
public int IntProp
{
get
{
return intProp;
}
set
{
intProp = value;
}
}
public string StringProp
{
get
{
return stringProp;
}
set
{
stringProp = value;
}
}
public DateTime DateProp
{
get
{
return dateProp;
}
set
{
dateProp = value;
}
}
}