Я читаю несколько свойств в конструкторе объекта. Одним из свойств является вычисление другого свойства.Как добавить присвоенное значение свойства объекту?
Но когда я создаю этот объект вычисленного значение свойства Implementation_End_String
всегда нуль:
private string implementationEndString;
public string Implementation_End_String {
get{
return implementationEndString;
}
set {
implementationEndString= DataTimeExtensions.NullableDateTimeToString(Implementation_End);
}
}
Вопрос:
Как можно передать в рассчитанной собственности конструктора объекта?
Это суть в CTOR и вычислил свойство:
private string implementationEndString;
public string Implementation_End_String {
get{
return implementationEndString;
}
set {
implementationEndString= DataTimeExtensions.NullableDateTimeToString(Implementation_End);
}
}
public DateTime? Implementation_End { get; set; }
public ReleaseStatus(DateTime? implementationEnd)
{
//value is assigned at runtime
Implementation_End = changeRequestPlannedImplementationEnd;
}
Возможный дубликат [? Что такое NullReferenceException, и как это исправить] (http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – mybirthname