{{indexmenu_n>60}}
===== Preparation of source objects =====
- Create a new project ( class library ) and add eBiss.DbAdapter.dll to References((If you need information on the scheme, you can refer to the structure from our HowTo [[en:howtos:plugins:csvplugin|create csv plugin]])).
- Create a new object that inherits from IMapObjectRoot ((You can also copy existing ones from your plug-ins)).
- Now add the required attributes as appropriate for your database shown below.
[PrimaryKey(PrimaryKeyType.Counter, "Counters", "Name = 'HeaderTable'", "Current")]
public int Key;
This declares a primary key that gets the values from the // Counters // column // Current // with // Name = HeaderTable //.
[Relation("Key")]
public int HeaderKey;
This declares a field, depending on the Parent-Object // Key //, so that the field automatically gets the value of the referenced column.
[NotMapped]
public string RefTableKey = "10-Wert";
This declares a non-mapped field in the database. It is ignored while writing.
[LookupReference(LookupType.Optional, "RefTable", "Id", "LookupValue = @RefTableKey")]
public int RefTableRef;
This allows you to fill the reference from another table into the database. In this case, we look in // RefTable // for the column // Id // where // LookupValue = // Context of a local field name // RefTableKey //.