public static IEntityCollection <T> BulkLoad <T>(this IEntityCollection <T> list, IEnumerable <T> data, bool clear)
            where T : class
        {
            list.BeginInit();

            if (clear)
            {
                list.Clear();
            }

            list.AddRange(data);
            list.EndInit(true);

            return(list);
        }
Esempio n. 2
0
 /// <summary>
 /// Removes all items from the <see cref="ICollection{T}" />.
 /// </summary>
 public void Clear() => _entities.Clear();