Hi,

I've created a little function that should add the MappingRules from code instead of from the configuration. It does not work however. What is missing? Here is the code:

private static void AddMappingRule(DomainConfiguration configuration, string assemblyName, string space, string schema)
    {
        System.Reflection.Assembly assembly = System.Reflection.Assembly.Load(assemblyName);

        configuration.Types.Assemblies.Add(assembly);

        configuration.MappingRules.Add(new MappingRule(assembly, space, null, schema));
    }

        AddMappingRule(configuration, "Projecten.Model", "Projecten.Model.Entities", "Projecten");
        AddMappingRule(configuration, "Fortrus.Reporting.Model", "Fortrus.Reporting.Model.Entities", "Reporting");

Regards Paul

asked Aug 08 '13 at 09:10

Paul%20Sinnema's gravatar image

Paul Sinnema
261878896


One Answer:

Hello Paul,

here is the post that describes configuration in short.

Certian things that worth mentioning:

  • Mapping rules does not account child namespaces. Those are considered separate.
  • Standard way to add assembly to DomainConfiguration is to use Types.Register method.
  • You might consider using fluent API instead of constructing rules manually.

answered Aug 09 '13 at 03:21

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov
179325

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA