[EFCore] Relationship Data 수정 하기
·
공부/EFCore
1️⃣ 1 대 1 관계에서 데이터 수정 Player는 하나의 Item만 소지할 수 있다. Player의 아이템 명을 변경해보자. public static void Update_1v1() { ShowItems(); Console.WriteLine("Input ItemSwitch PlayerId"); Console.Write(" > "); int id = int.Parse(Console.ReadLine()); using (AppDbContext db = new AppDbContext()) { Player player = db.players .Include(p => p.Item) // Include가 빠지면 Item이 Player를 참조하고 있다는 사실을 알 수 없어 Error 발생 .Single(p => p..