I managed to create the table in the database with this mapping, however
the list in my repository back to the property Roles own class instead of
their children.
I made only one Session.Query <role> (). I would have to do some treatment
to bring the list correctly?
Em terça-feira, 1 de outubro de 2013 08h48min47s UTC-3, Ricardo Peres
escreveu:
>
> 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.