Auto mappings and nested types.

Original Post Steve's Avatar

Steve

09 Apr, 2010 03:33 PM via web

It seems that automappings does not support nested classes (?)

I have class PrivateDiscussionTopic which is an aggregate root and it contains set of objects of type Message which is nested in PrivateDiscussionTopic. When I use this:

m.AutoMappings.Add(AutoMap.AssemblyOf().Where(t => t.IsSubclassOf(typeof(EntityBase))))

it tells me:

NHibernate.MappingException : An association from the table PrivateDiscussionTopic refers to an unmapped class: Athletics.Domain.Discussions.PrivateDiscussionTopic+Message.

(Message is subclass of EntityBase) How can I explicitly say I want that class to be included in mappings?

  1. Support Staff 2 Posted by James Gregory on 16 May, 2010 05:43 PM

    James Gregory's Avatar

    Nested types are completely unsupported with the automapper. You need to extract your class for it to be used with the automapper.

  2. James Gregory resolved this discussion on 16 May, 2010 05:43 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

05 Jul, 2010 10:29 PM
05 Jul, 2010 12:45 PM
05 Jul, 2010 12:42 PM
05 Jul, 2010 12:17 PM
05 Jul, 2010 12:12 PM

 

03 Jul, 2010 12:26 AM
02 Jul, 2010 02:17 PM
02 Jul, 2010 08:18 AM
02 Jul, 2010 12:20 AM
01 Jul, 2010 10:14 PM