xpo-devexpress-dot-xpo-dot-exceptions-49892e82.md
An exception that is thrown when a key field doesn’t support automatic value generation
Namespace : DevExpress.Xpo.Exceptions
Assembly : DevExpress.Xpo.v25.2.dll
NuGet Package : DevExpress.Xpo
public class KeysAutogenerationNonSupportedTypeException :
Exception
Public Class KeysAutogenerationNonSupportedTypeException
Inherits Exception
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.
Object Exception KeysAutogenerationNonSupportedTypeException
See Also