Ok, so just to answer myself here, found the answer right after
posting the question...

mapper.IsSet((mi, declared) => {
        var memberType = mi.GetPropertyOrFieldType();
        return memberType.IsGenericType &&
memberType.GetGenericTypeDefinition() == typeof(ICollection<>);
});

and

mapper.IsPersistentProperty((mi, declared) => mi.Name.ToUpper() !=
"NAME");

but what about when doing it for just one property?
mapper.Class<Survey>(cm => cm.Property(s => s.Name, pm => pm.????));

On 15 Maj, 00:56, Neo <[email protected]> wrote:
> Hi,
>
> Testing the new Mapping.ByCode in the upcoming NHibernate 3.2 and
> could not find out how to get it to produce my one-to-many collections
> as sets...
>
> If I have an entity like:
> public class Survey : Entity
> {
>     public virtual string Name { get; set; }
>     public virtual ICollection<Question> Questions { get; set; }
>
>     public Survey() {
>         this.Questions = new HashedSet<Question>();
>     }
>
> }
>
> How would I use the ConventionalModelMapper to create "set"s in the
> mappings for any ICollection<> ?
> (i.e the same thing as in ConfOrm would be: orm.Patterns.Sets.Add(new
> UseSetWhenGenericCollectionPattern());)
>
> And also, how do I exclude a property from beeing mapped?
>
> Cheers!

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to