\r
//Check AutoIncrement status, make compatible datatype\r
if(AutoIncrement == true) {\r
- // we want to check that the datatype is supported?\r
- // TODO: Is this the same as CanAutoIncrement or was the omission of Decimal intended?\r
- TypeCode typeCode = Type.GetTypeCode(value);\r
-\r
- if (typeCode != TypeCode.Int16 &&\r
- typeCode != TypeCode.Int32 &&\r
- typeCode != TypeCode.Int64) {\r
+ // we want to check that the datatype is supported? \r
+ if (!CanAutoIncrement (value))\r
AutoIncrement = false;\r
- }\r
}\r
\r
if (DefaultValue != GetDefaultValueForType (prevType))\r
//Copy.Container\r
copy.DataType = DataType;\r
copy._defaultValue = _defaultValue;\r
- copy._expression = _expression;\r
+ // Use the property to set the expression as it updates compiledExpression, if any.\r
+ copy.Expression = _expression;\r
//Copy.ExtendedProperties\r
copy._maxLength = _maxLength;\r
copy._nameSpace = _nameSpace;\r
if (DataType == typeof (DateTime))\r
copy.DateTimeMode = _datetimeMode;\r
#endif\r
+ copy._extendedProperties = _extendedProperties;\r
\r
return copy;\r
}\r