/// <summary>
        /// Determines whether the type is registered
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity.</typeparam>
        /// <param name="coll">The collection to check.</param>
        /// <param name="type">The type to lookup.</param>
        /// <returns>
        ///     <c>true</c> if this type is allowed; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsRegistered <TEntity>(this IEntityCollection <TEntity> coll, System.Type type)
            where TEntity : IEntity
        {
            if (coll == null)
            {
                throw new ArgumentNullException("coll");
            }
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (!typeof(IEntity).IsAssignableFrom(type))
            {
                throw new ArgumentException(string.Format("Type {0} is not assignable from {1}", type.FullName, typeof(IEntity).FullName));
            }

            return(coll.Any(x => x.GetType() == type));
        }