using System.Collections.Generic; namespace zero.Core.Identity { public class PermissionGroupCollection : List { public void Add(int index = -1) where T : PermissionCollection, new() { if (index > -1 && index < Count) { Insert(index, new T()); } else { Add(new T()); } } } }