Fluent NHibernate mapping

后端 未结 5 1760
天涯浪人
天涯浪人 2021-02-06 02:21

I\'m new to NHibernate and Fluent NHibernate.

Assuming I have a situation like the following

Table Activities (uniquidentier ID, varchar ActivityName)
Ta         


        
5条回答
  •  感情败类
    2021-02-06 02:32

    This seems helpful.

    Theoretically it should look like:

    public class ActivityClassMap : ClassMap
    {
        ...
        HasMany(x => x.ActivityParameters) 
          .AsMap(x=>x.NameOfParameterOrWhatever)
          .KeyColumnNames.Add("ParameterId"); 
        ...
    }
    

    But that's just a small investigation through google - I didn't try this in practice.

    P.s. don't forget to pick up the newest version.

提交回复
热议问题