tags:

views:

21

answers:

1

Hello,

I've run into a nhibernate dilemma that I'm sure can be solved, cause I haven't run into a problem yet that can't be. I have a couple of small classes:

class PropertyDataString : IPropertyData
  string Value {get; set;}
  void Render() { ..render string property.. }

class PropertyDataSelection : IPropertyData
  string Value {get; set;}
  void Render() { ..render selection property.. }

and the interface:

interface IPropertydata
  string Value { get; set; }
  void Render() {}

Now I have a parent class:

class Parent
  List<IProperty> Properties

The question how can I map this? As you see both PropertyDataString and PropertyDataSelection has the same properties only difference is in the interface implemented methods.

A: 

Chapter 8. Inheritance Mapping

In this case, I recommend the Table per class hierarchy strategy.

Diego Mijelshon
I didn't know that it allowed you to return an interface, but it seems it does. I'll try it.
ZNS