Create Business Class with Database First

2 posts, 0 answers
  1. Support ATT
    Support ATT avatar
    66 posts
    Member since:
    Nov 2004

    Posted 29 Jul 2013 Link to this post

    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; }

  2. Kaloyan Nikolov
    Admin
    Kaloyan Nikolov avatar
    118 posts

    Posted 31 Jul 2013 Link to this post

    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.
  3. DevCraft banner
Back to Top