Sure:
var mapper = new ModelMapper();
mapper.Class<MyClass>(ca =>
{
ca.Id(x => x.Id, map =>
{
map.Column("myclass_id");
map.Generator(Generators.Identity);
});
ca.Property(x => x.Name, a =>
{
//fill in the blanks
});
ca.ManyToOne(c => c.Parent, a =>
{
map.Column("parent_id");
//fill in the blanks
});
ca.Bag(c => c.ListClass, c =>
{
c.Key(x => x.Column("myclass_id"));
c.Inverse(true);
//fill in the blanks
}, c => c.OneToMany());
}
What exactly is your problem?
RP
On Monday, September 30, 2013 9:07:15 PM UTC+1, Tiago Azevedo wrote:
>
> Someone could tell how to perform the mapping of this class?
>
> public class MyClass
> {
> public virtual int Id { get; set; }
> public virtual string Name { get; set; }
> public virtual Role Parent { get; set; } // or public virtual int ParentId
> { get; set; } ???
> public virtual IList<MyClass> ListClass{ get; set; }
> }
>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.