开发者

Fluent NHibernate mapping inheritance

开发者 https://www.devze.com 2023-03-16 04:10 出处:网络
Can I have map a abstract class even the object doesn´t exists in my database? Example: public abstract class Type

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?

T开发者_如何学Gohanks.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消