Automapping - eager loading some classes

Simon's Avatar

Simon

15 Sep, 2010 05:10 PM via web

I'd like to override automapping to mark some (but not all) classes as to be eager loaded by default? Are there any samples available that show how to do that?

Thanks!

  1. Support Staff 2 Posted by Paul Batum on 25 Sep, 2010 10:31 PM

    Paul Batum's Avatar

    public class PersonMappingOverride
      : IAutoMappingOverride<Person>{
      public void Override(AutoMapping<Person> mapping)
      { mapping.HasMany(x => x.Orders)
                .Not.LazyLoad();
      }}

    See: http://wiki.fluentnhibernate.org/Auto_mapping#Overrides

    You might want to specify the fetch type as well, such as:
       .Fetch.Join()

    On Wed, Sep 15, 2010 at 12:12 PM, Simon <
    ***@tenderapp.com<tender%***@tenderapp.com>
    > wrote:

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is the last month of the year?