Code Generation (Dna classes)

Description

Main purpose of these classes- is to be non intrusive replacement for ExtensionClasses generator. Generally you do not want to use it, cause ExtensionClasses provides much better code. This generator is supposed to be used for special purposes.

For ExtensionClasses to work, they should be recognizable by core engine. So core engine should "know" about those classes and use them while creating objects for table's rows instead of generic BGEntity class.

Dna classes generate additional properties for each table's field, however still using basic BGEntity object

Here is an example:

public partial class Repo : BGDna
{
    public static BGD_MyTable MyTable
    {
        get
        {
            return I.MyTable;
        }
    }

    public partial class BGD_MyTable : BGDnaMeta
    {
        public BGDnaField<System.Int32> myField;
    }
}

to access MyTable.myField int field, use this code

//getter
var intValue = Repo.MyTable.myField.Get(entity);

//setter
Repo.MyTable.myField.Set(entity, 1);