Skip to main content

KeysAutogenerationNonSupportedTypeException Class

An exception that is thrown when a key field doesn’t support automatic value generation

Namespace: DevExpress.Xpo.Exceptions

Assembly: DevExpress.Xpo.v24.2.dll

NuGet Package: DevExpress.Xpo

#Declaration

public class KeysAutogenerationNonSupportedTypeException :
    Exception

#Remarks

Only Int32, Int64 and Guid key fields support automatic value generation. This exception is thrown when automatic key generation is enabled for a key property but the property type doesn’t support this feature,

Solution:

- use an integer or GUID property as a key field;

- disable automatic key generation for a property and set an object’s key manually.

To enable/disable automatic key generation for a property use the autoGeneration parameter of the property’s KeyAttribute attribute.

#Inheritance

Object
Exception
KeysAutogenerationNonSupportedTypeException
See Also