EFDAL: Global settings

May 11, 2011 at 3:19 PM

I just ran into a situation where the generated EFDAL code rejected an attempt to set a DateTime field value to DateTime.Min. Looking into the Global settings file I see that there is a limit imposed on the minimum and maximum values of dates. Is there a reason for this to be different from the minimum and maximum values of DateTime? If not, is there a setting exposed in the schema file which lets me specify what the limits should be?

May 11, 2011 at 11:06 PM

Yes there is a difference. SQL Server has a min date of 1/1/1753 so we do not allow values in the C# code setters that will only later blow of SQL Server on the save. This is a convenience (even though it does not feel like it).

May 11, 2011 at 11:27 PM

I thought it might be something like that, but I'm not an expert on SqlServer... :) Thanks for the info.