public static void Many_to_many_relationships_7() { Console.WriteLine($">>>> Sample: {nameof(Many_to_many_relationships_7)}"); Console.WriteLine(); Helpers.RecreateCleanDatabase(); Helpers.PopulateDatabase(); #region Many_to_many_relationships_7 using var context = new BlogsContext(); var post = context.Posts.Single(e => e.Id == 3); var tag = context.Tags.Single(e => e.Id == 1); post.Tags.Add(tag); context.SaveChanges(); Console.WriteLine(context.ChangeTracker.DebugView.LongView); #endregion Console.WriteLine(); }