This is a migrated thread and some comments may be shown as answers.

Create Business Class with Database First

1 Answer 38 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Support ATT
Top achievements
Rank 1
Support ATT asked on 29 Jul 2013, 12:40 PM
HI
How can i achieve this ?

I'm using Database First mechanism. But i would like to make my own Business model class which extends the Auto generated class with attributes like this.

[DbTable(_A06.TABLE_NAME)]

public class Kontakte : AdresseBase

{

#region field properties

/// <summary>

/// (Auto) Eindeutige Record-Nummer

/// <summary>

[DbColumn(A06.RECID)]

public Int32 Recid { set; get; }

/// <summary>

/// Eindeutige Laufnummer

/// <summary>

[DbColumn(A06.LAUFNUMMER)]

public Int32 Laufnummer { set; get; }

/// <summary>

/// Adressnummer, Verbindung zu A05

/// <summary>

[DbColumn(A06.NUMMER)]

public Int32 Nummer { set; get; }

1 Answer, 1 is accepted

Sort by
0
Kaloyan Nikolov
Telerik team
answered on 31 Jul 2013, 11:55 AM
Hi,

You can achieve this relatively easy with customization in our out of the box code generation templates. Here is an article describing how this should be done. 

Please find attached a sample application demonstrating the approach. You can see the changes in the "DefaultTemplateCS.tt" file at line 59:

I hope this helps. Please do not hesitate to get back to us if you have further questions. 

Regards,
Kaloyan Nikolov
Telerik
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
Tags
Development (API, general questions)
Asked by
Support ATT
Top achievements
Rank 1
Answers by
Kaloyan Nikolov
Telerik team
Share this question
or