Fluent API - per-class configuration and context

Thread is closed for posting
4 posts, 0 answers
  1. jc mag
    jc mag avatar
    106 posts
    Member since:
    Aug 2005

    Posted 01 Oct 2011 Link to this post

    I was trying your per-class configuration example (http://www.telerik.com/help/openaccess-orm/fluent-mapping-integration-enhancer-per-class-configuration.html); and you said:
    "The benefit in this case is that you are not obligated to create a class that derives from FluentMetadataSource and to override the abstract PrepareMapping method"

    But then, how should I update my FluentContext class? If I have no MetadataSource class what should I pass in the constructor?

    public class FluentContext : OpenAccessContext
            //static MyFluentMetadataSource metadataSource = new MyFluentMetadataSource();
            static BackendConfiguration backendConfiguration = new BackendConfiguration()
                Backend = "mssql"
            private const string DbConnection = "ConnectionString";
            public FluentContext()
                : base(DbConnection, backendConfiguration, ??)
  2. Serge
    Serge avatar
    375 posts

    Posted 04 Oct 2011 Link to this post

    Hello Jc Mag,

     Unfortunately this seems to be an error in the documentation, you still need to create and implement the abstract FluentMetadataSource. The PrepareMapping you have to override should just return an empty list. With this setup, during runtime the mapping will be collected from all of the classes having a static method that returns a MappingConfiguration

    We will be updating the help topic immediately. Thank you for noticing this error. 

    I hope this helps.

    Kind regards,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

  3. bohebolo
    bohebolo avatar
    31 posts
    Member since:
    Aug 2010

    Posted 20 Nov 2012 Link to this post

    It seems the online documentation has not been updated yet.
    I spent several hours only for this...

  4. Ivailo
    Ivailo avatar
    318 posts

    Posted 23 Nov 2012 Link to this post


    Thank you for pointing us to that omission and please accept our apologies for it. The article will be updated immediately and the fix will be live within two weeks. We have updated your Telerik Points for helping us out.  

    Do not hesitate to get back to us if you find any other issues or you have questions regarding the usage of Fluent API.

    All the best,
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
Back to Top