Code Generator support for Abstract Classes in Fluent Model

Thread is closed for posting
3 posts, 1 answers
  1. Paul
    Paul avatar
    17 posts
    Member since:
    May 2011

    Posted 09 Sep 2014 Link to this post

    I would like to see improved metadata support for interpreting class definitions in the Telerik Code Generator.

    When I define an abstract base class in my Fluent database model, the Data Service Wizard is unaware that the class was abstract.  My goal is to customize the T4 templates to provide a complete DTO mapping for my inheritance structure, but the CodeClass.TypeInheritanceModifer property does not reflect the fact my class was declared abstract, so I am unable to declare the associated DTO as abstract.
  2. Answer
    Kristian Nikolov
    Kristian Nikolov avatar
    206 posts

    Posted 12 Sep 2014 Link to this post

    Hi Paul,

    Thank you for contacting us.

    The behavior you are experiencing is a known limitation of the Service Wizard. Normally the  TypeInheritanceModifer property will indicate whether the class is abstract or not. However as you have noticed in a scenario where a Fluent Model is used, at the time of generation this is not the case. The reason for this is that when Fluent Model is used the Service Wizard does not have the required metadata for this property. This unfortunately means that currently you would be unable to generate abstract DTO`s for abstract classes.

    As we are always looking for ways to improve Telerik Data Access we suggest you post a feature request at our Feedback Portal and vote for it. Doing so will help us prioritize its eventual implementation.

    I hope this helps. Should you have further questions do not hesitate to use our forums again.

    Kristian Nikolov
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
  3. Paul
    Paul avatar
    17 posts
    Member since:
    May 2011

    Posted 12 Sep 2014 in reply to Kristian Nikolov Link to this post

    Thanks Kristian.

    I have submitted the feature request to your feedback portal as you suggested.

    Paul S.
Back to Top