public void Remove_SubEntity_Detached()
        {
            User userWithGroups;

            using (var context = new MeetupContext())
            {
                var tmpUser = _context.Users
                              .Include(x => x.Groups)
                              .ThenInclude(x => x.Group)
                              .First(x => x.Id == 1);

                tmpUser.Groups.Add(new UserGroup {
                    UserId = tmpUser.Id, GroupId = 1
                });
                context.SaveChanges();

                userWithGroups = _context.Users
                                 .Include(x => x.Groups)
                                 .ThenInclude(x => x.Group)
                                 .First(x => x.Id == 1);
            }

            var group = userWithGroups.Groups.FirstOrDefault();

            userWithGroups.Groups.Remove(group);
            _context.Attach(userWithGroups);
            _context.SaveChanges();
        }