I have the below situation that I need help figure it out.
I am using fluent nhibernate with a legacy database. I need to map
some additional columns to a dictionary(?) property in my entity
dynamically, because I do not know the number of columns and column
names and other specifications at compile time and I dynamically need
to work with those columns(insert,update...).There is another object
which has those information and has a relationship with my main entity
based on the value of two other columns.Is this possible in
nhibernate?
I tried to use DynamicComponent but the problem is I don't know what
would be the properties in my component.
I have something like this:
In Entity.cs :
public virtual IDictionary AdditionalFields { get; set; }
public virtual Info AdditionalFieldsInfo{get; set;}
And in EntityMap.cs:
References(x => x.AdditionalFieldsInfo);
and I supposedly should have something like this:
DynamicComponent(x => x.AdditionalFields , m =>
{
m.Map(?Which I don't know how to map because I dont have the number of
columns to be mapped and column names.These information needs to come
from AdditionalFieldsInfo);
});
I also posted the question to nhusers group(
nhu...@googlegroups.com)
but I still not very sure how to implement this.
I do appreciate if someone could help.
Thanks.
Silvia