Fluent NHibernate: How to Map List<String> -
i know there lots of questions how map list of strings using fluent nhibernate. tried options got. still no luck.
my situation follows.
class baseclass { public string name {get;set;} } class firstchild : baseclass { public string parameter{get;set;} public ilist<string> otherparameter {get;set;} }
the mapping file using follows:
public class baseclassmap: classmap<baseclass> { public baseclassmap() { table("baseclass"); map(x => x.name); discriminatesubclassesoncolumn<string>("class"); } } public class firstchildmap : subclassmap<firstchild> { public firstchildmap () { map(x => x.parameter); hasmany(x => x.otherparameter) .element("otherparameter ") .table("otherparametertable").cascade.alldeleteorphan(); } }
after when try save object of type firstchild
, saves value of name
, parameter
nothing goes otherparametertable
.
can tell me going wrong?
Comments
Post a Comment