dotConnect for DB2 Documentation
In This Topic
    Query Options
    In This Topic

    dotConnect for DB2 has some options that customize translating LINQ to Entities to SQL statements. The list of these options includes:

    Please note that the last two options work with both common DefaultValue SSDL attribute and the new custom devart:DefaultValue SSDL attribute. The latter attribute does not trigger the type consistency check, so you can use a wider range of default values, like CURRENT TIMESTAMP or NEXT VALUE FOR MY_SEQUENCE.

    Here is a simple example:

    <Property Name="ProductID" Type="int" Nullable="false" 
    devart:DefaultValue="NEXT VALUE FOR MY_SEQUENCE" StoreGeneratedPattern="Identity" />

    The generated SQL command looks like the following:

    INSERT INTO "Product"
      ("ProductID","ProductName","UnitScale","InStock","Price","DiscontinuedPrice")
      VALUES(NEXT VALUE FOR MY_SEQUENCE,:p0,:p1,:p2,:p3,:p4)

    These options can be set either in code as the properties of the EntityProviderConfig.QueryOptions object or in the project config file as the attributes of the QueryOptions element of the Devart.Data.DB2.Entity tag.