public bool GeneratesType(Type type, IBuilder builder, BuildSession session) { var maxInstances = session.GetMaximumNumberOfInstances(type); if (maxInstances != null) { var countOfObjs = GetAllInstancesOf(session.ConstructedNodes, type).Count(); return(countOfObjs >= maxInstances.Value); } return(false); }