Powered by Zoomin Software. For more details please contactZoomin

DataDirect Connect for ADO.NET Data Provider Help

Code First and Model First Support

  • Last Updated: April 16, 2026
  • 2 minute read
    • ADO.NET
    • Documentation

Entity Framework 4.1 and later provide support for the Model First and Code First features. Implementing support for these features requires changes to the data provider, such as the way that long identifier names are handled. However, these changes do not not require changes to your application.

Code First and Model First implementations require type mapping changes. See Mapping Data Types and Functions for more information.

Handling Long Identifier Names

Most DB2 identifiers have a maximum length of 30 bytes. The identifier name can exceed this size because the names of the objects to be created on the server are taken from the class and property names. In addition, constraint names are often created by concatenating several object names. In these cases, the chances of exceeding the maximum identifier length are even greater.

The maxIdentifierLength attribute enables developers to specify the maximum length for all Identifiers. The data provider then shortens identifiers to the value specified by the developer, replacing the end of the identifier with an integer hash-code. For example, the string Seq_RkoPersonWithMoodAndShirts_Id is shortened to Seq_RkoPersonWithMo_3584187919, if the maxIdentifierLength is specified as 30 by the developer.

If you access or view the DB object using a DB tool, the names of the created tables may differ from what you might expect based on the Plain Old CLR Object (POCO) class names and property names (Code First), or the entity names and entity property names (Model First).

Note that when two identifiers that have the same leading characters are shortened, the difference between the identifiers is less obvious to a visual inspection. For example, assume that a table has two supporting sequences, Seq_RkoPersonWithMoodAndShirts_Id and Seq_RkoPersonWithMoodAndJackets_Id. When these sequences are shortened, they are renamed Seq_RkoPersonWithMo_3584187919 and Seq_RkoPersonWithMo_2865783621.

TitleResults for “How to create a CRG?”Also Available inAlert