Relationships between custom tables and membership

WekLieteNes

New Member
I see lots of people say don't associate your tables to membership provider's table directly.But this is the scenario how can I solve it:
  • I use sqlmembershipprovider for membership.
  • there are some offices which have personnel, \[code\]Doctors\[/code\] and \[code\]Secretaries\[/code\].
  • I have a table for \[code\]doctors\[/code\] another for \[code\]secretaries\[/code\]
  • each doctor/secretary should have anaccount for signing in.\[code\] public class Doctor { public Doctor() { this.Expertises = new HashSet<Expertise>(); } [Key] public int DoctorId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } [ForeignKey("Office")] public int OfficeId { get; set; } public virtual aspnet_Users User { get; set; } public virtual Office Office { get; set; } public virtual ICollection<Expertise> Expertises { get; set; } }\[/code\]
Secretary:\[code\] public class Secretary { [Key] public int SecretaryId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } // the rest.. [ForeignKey("Office")] public int OfficeId { get; set; } public virtual aspnet_Users User { get; set; } public virtual Office Office { get; set; } }\[/code\]I thought I can make a relationship between doctor/secretary table to \[code\]user\[/code\] table of membership provider, but this seems not a good approach.So how can I solve this?
 
Back
Top