0

I have two tables like this:

public partial class Major
{
        public int Id { get; set; }

        [Required]
        public string Name { get; set; }
        public ICollection<Salon> Salons { get; set; }
}

public class Salon
{
       public int Id { set; get; }
       public string Title { set; get; }
       public ICollection<Salon> Salons { get; set; }
}

In the table Major, I have data like this:

Id  Name
-----------------
1   basketball
2   vollyball

and my problem is when I am adding a new record to the Salon table with related data of basketball and volleyball; these two records have been added as new records to the Major table when they already existed...

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • ***SHOW US THE CODE!*** We cannot possibly help you if you only talk about it - **SHOW IT!** - after all, we cannot read your screen, nor your mind - you need to show us, so that we have any chance of helping you! – marc_s Aug 03 '19 at 20:30
  • This has been asked before, for example: https://stackoverflow.com/q/4253165/861716. – Gert Arnold Aug 03 '19 at 20:57

0 Answers0