The encrypted domain as your
public interface IInter
{
string X { get; set; }
}

public class A : Entity
{
public virtual IInter Y { get; set; }
}

public class B : Entity, IInter
{
public virtual string X { get; set; }
}
public class C : Entity, IInter
{
public virtual string X { get; set; }
}

The mapping
private void ConfOrmMapping(ObjectRelationalMapper orm, Mapper mapper)
{
 }

And it work perfectly:
using (var s = sf.OpenSession())
using (var tx = s.BeginTransaction())
{
var b = new B { X = "TOP" };
var c = new C { X = "SECRET" };
var a1 = new A { Y = b };
var a2 = new A { Y = c };
s.Persist(b);
s.Persist(c);
s.Persist(a1);
s.Persist(a2);
tx.Commit();
}


On Mon, Mar 7, 2011 at 5:51 PM, Univac <[email protected]> wrote:

> Hello, i want to map this simple model
>
> public interface Inter
>  {
>   Guid Id { get; set; }
>  }
>
> public class A
>  {
>  public virtual Inter A { get; set }
>  }
>
> public class B : Inter
>  { ... }
> public clas C: Inter
>  { ... }
>
> The reference held by A can point to B or C, thanks to the interface.
> How do I map that?
>
> --
> 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.
>
>


-- 
Fabio Maulo

-- 
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