0
votes

Hi have are very complex design of entities aggregation in project. I'm using domain driven development. To map entites i'm using FluentNHibernate

Here is my design of domain


    public abstract class Domain
    {
    public virtual long Id{get;set;}
    }

    public ClassA:Domain
    {   

        public virtual DateTtime Time{get;set;}
        public virtual ClassC C1 {get;set;}
        public virtual IList List{get;set;}

    }

    public ClassC:Domain
    {
    public virtual string Schedule{get;set;}
    }

    public ClassD:Domain
    {
       public virtual string PropClassD{get;set;}
    }

    public ClassE:ClassD
    {
    public virtual string PropClassE{get;set;}
    }

    public ClassF:ClassD
    {
    public virtual string PropClassF{get;set;}
    }

    public ClassG:Domain
    {
    //Composite key ClassA+ClassD
        public virtual ClassA C1 {get;set;}
        public virtual ClassD C2 {get;set;}
    }

I tried different settings with mapping, but nothing is working. My aggregate root is ClassA.

Following Single class inhertance for ClassE and ClassF table.

Please help to make it work.

1

1 Answers

0
votes

When I don't know how to map the objects I use Entity Developer http://www.devart.com/entitydeveloper/ They have a free version that supports up to eight entities. At least can give you some hints in a concrete case. Given the relative lack of Fluent NHibernate documentation, this tool is also educational. You can see an example of the mappings produced by this tool here http://www.codeproject.com/Articles/232034/Inheritance-mapping-strategies-in-Fluent-Nhibernat