How to create mapping for a List<SomeNativeType> in FluentNhibernate ?

Posted by Mahesh Velaga on Stack Overflow See other posts from Stack Overflow or by Mahesh Velaga
Published on 2010-03-24T09:01:11Z Indexed on 2010/03/24 9:03 UTC
Read the original article Hit count: 288

Hi all,

I am trying to create a mapping file for the following Model using Fluent NHibernate. But, I am not sure of how to do the mapping for the List in the mapping file.

    public class MyClass
    {
        public virtual Guid Id { get; set; }
        public virtual string Name { get; set; }
        public virtual List<string> MagicStrings { get; set; }
    }

    public class EnvironmentMapping : ClassMap<Models.Environment>
    {
        public EnvironmentMapping()
        {
            Id(x => x.Id);
            Map(x => x.Name);
            //HasMany(x => string)  What should this be ?
        }
    }

Help in this regard is much appreciated. Thanks!

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about fluent-nhibernate