I use following Linq To Entitiy To get the first and only record of my 'siteconfig' Entity :
var site = unitofwork.SiteConfigRepository.Get().FirstOrDefault();
But when my application comes to the following code, throws 'nullable object must have a value' :
if (site!= null) { TimeSpan span = DateTime.Now.Subtract((DateTime)site.logindDate ); }
And the only nullable type in my entity is a property called logindDate and is of type DateTime.
Any one help me out?