Hi all, I have a problem with generics, and I'm not sure if this scenario it is possible.
I have a class that represent my primary keys (PrimaryKey<T>) and I don't know how write it in the hbm file.
I have been looking for info and samples but I haven't found nothing.
Fragment code:
namespace MyNHibernateSample
{
public class MyEntity
{
private PrimaryKey<string> id_1;
private PrimaryKey<int?> id_2;
public PrimaryKey<string> Id_1
{....}
public PrimaryKey<int?> Id_2
{....}
}
}
namespace MyNHibernateSample
{
public class PrimaryKey<T>
{
private T oldKey;
private T mKey;
public PrimaryKey(T key)
{
this.mKey = key;
this.oldKey = key;
}
...........
}
}
Any help would be appreciated.
Best Regards.
|