This is the 2nd time of late this issue has come up of late, though not in relation to serialization, here is the issue.
Our low-level get methods look like this:
Code:
protected System.Int16? GetSystemInt16(string columnName)
{
if (this.row == null) this.AddNew();
object o = this.row[columnName];
return (o == DBNull.Value) ? null : (System.Int16?)o;
}
Notice, they don't check the Columns collection to make sure "columnName" exists, EntitySpaces has always been this way for performance, it's usually not a problem. If you don't bring back a column don't access it, however, serialization blindly accesses all of the properties. In order to fix it we would have to do something like this:
Code:
protected System.Int16? GetSystemInt16(string columnName)
{
if (this.row == null) this.AddNew();
if (this.row.Table.Columns.Contains(columnName))
{
object o = this.row[columnName];
return (o == DBNull.Value) ? null : (System.Int16?)o;
}
else
{
return null;
}
}
The issue was/is we didn't want to have to ask if the column existed every time we were about to access it. We are going to do some performance analysis and come up with the proper solution for our mid December maintenance release. Unfortunately it wont make it into our official v1119 release.
EntitySpaces |
Twitter |
BLOG | Please honor our Software License