Hi @arsar ,
Now,your relationship is one user have many relationship.It means that each relationship points to a user.You like do this:
namespace UI.Models
{
[Table("Address_tbl")]
public class Address
{
[Key]
public int AddressId { get; set; }
[Required]
public string Address_Name { get; set; }
public virtual User Users{ get; set; }
}
[Table("User_tbl")]
public class User
{
[Key]
public int UserId { get; set; }
[Required]
public string Name { get; set; }
public virtual Addresser Addresss{ get; set; }
}
[Table("Relationship_tbl")]
public class Relationship
{
[Key]
public int Relationship_Id { get; set; }
[Required]
public string Address_Name { get; set; }
public User user{ get; set; }
}
}
Best regards,
Yijing Sun
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.