Vinicius Mesquita
Vinicius Mesquita

Reputation: 11

Fluent NHibernate mapping inheritance

Can I have map a abstract class even the object doesn´t exists in my database?

Example:

public abstract class Type
{
  public string Id{get; set;}
}

And the subs:

public class TypeA : Type
{
}

public class TypeB : Type
{
}

A class who needs the reference to base class:

public class Other
{
  public Type MyType{get; set;}
}

The Type doesn´t exists in my database, but I need this map to references in other classes, how I can map this?

Thanks.

Upvotes: 0

Views: 917

Answers (1)

Vinicius Mesquita
Vinicius Mesquita

Reputation: 11

I´ll let the abstract class like a "fake" map, for now my problem is resolved. Thanks.

Upvotes: 1

Related Questions