Hi, Thanks for the reply. One employee can have more than one address(Work,Home). My entities should look like the one listed below , Its my assumption. Correct me If i am wrong. I want to call Save() method on Employee object to store data in Employees as well as Addresses table.
public class Employee : Entity { public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual string Gender { get; set; } public virtual int Age { get; set; } public virtual Address WorkAddress { get; set; } public virtual Address HomeAddress { get; set; } } public class Address : Entity { public virtual Employee Employee { get; set; } public virtual string Line1 { get; set; } public virtual string Line2 { get; set; } public virtual string State { get; set; } public virtual string PostCode { get; set; } public virtual string County { get; set; } public virtual string AddressType { get; set; } } Regards, Vishal G. On Mon, Aug 29, 2016 at 4:57 PM, Gunnar Liljas <gunnar.lil...@gmail.com> wrote: > Are you using Fluent NHibernate? > Can an Employee have more than one address? > > Please show your entity classes. > > 2016-08-29 5:27 GMT+02:00 Michael Powell <mwpowell...@gmail.com>: > >> Well, for starters, you are posting in the NHibernate group, and you >> likely want the Fluent group. There is such a thing. >> >> Second, short of actually writing your code for you, what's wrong with >> following the plethora of one to many napping examples available with a >> simple Google or Bing search? >> >> If you have any esoteric questions, the groups are generally good about >> responding. >> >> HTH >> >> Regards, >> >> Michael Powell >> >> -- >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to nhusers+unsubscr...@googlegroups.com. >> To post to this group, send email to nhusers@googlegroups.com. >> Visit this group at https://groups.google.com/group/nhusers. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to nhusers+unsubscr...@googlegroups.com. > To post to this group, send email to nhusers@googlegroups.com. > Visit this group at https://groups.google.com/group/nhusers. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+unsubscr...@googlegroups.com. To post to this group, send email to nhusers@googlegroups.com. Visit this group at https://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/d/optout.