protected void UpdateManyToManyRelation <T>(IEnumerable <T> oldItems, IEnumerable <T> newItems) where T : class { context.RemoveRange(oldItems); context.AddRange(newItems); }