Field Naming rules for whole context

3 posts, 0 answers
  1. Jonah
    Jonah avatar
    21 posts
    Member since:
    Oct 2012

    Posted 25 Aug 2015 Link to this post

    I am applying naming rules to each of my tables like categoryConfig.FieldNamingRules.AddPrefix = "_"; so I don't have add the field name to each definition.

    Is there a way to apply the same rule to the whole context?

  2. Pavel Uzunov
    Pavel Uzunov avatar
    14 posts

    Posted 28 Aug 2015 Link to this post

    Hi Jonah,

    You can easily set FieldNamingRules to all your configurations with a simple loop:
    protected override IList<MappingConfiguration> PrepareMapping()
        List<MappingConfiguration> configurations = new List<MappingConfiguration>();
        configurations.ForEach(c => c.FieldNamingRules.AddPrefix = "_");
        return configurations;

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

    Pavel Uzunov
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
  3. DevCraft banner
  4. Vitaliy
    Vitaliy avatar
    36 posts
    Member since:
    Dec 2008

    Posted 10 Mar Link to this post

    What if I use a


Back to Top