private static bool IsValid(Domain domain, Type type, TemplateDomain element)
 {
     string typeName = element.TypeName;
     return typeName.Equals(type.FullName) ||
            (
                type.IsGenericType &&
                type.Name.Equals("Nullable`1") &&
                typeName.Equals(type.GetGenericArguments()[0].FullName)
            ) ||
            (
                CoreSection.Current.IsEntity(type) &&
                (
                    (domain is EntityCollectionDomain &&
                     typeName.Equals(((EntityCollectionDomain) domain).CollectionType.FullName)) ||
                    (domain is EntityCollectionDomain && typeName.Equals(TemplateDomain.CollectionKey)) ||
                    (domain is EntityDomain && typeName.Equals(TemplateDomain.SingleKey))
                )
            );
 }
 internal void Add(TemplateDomain domain)
 {
     base.BaseAdd(domain);
 }