Example #1
0
        /// <summary>
        /// Checks if the given resource is of type ScholarlyWork.
        /// </summary>
        /// <param name="resourceType">The resource Type string for which the type object is to be checked.</param>
        /// <returns>true if it is of type ScholarlyWork else false.</returns>
        public bool IsResourceTypeIsOfTypeScholarlyWork(string resourceType)
        {
            if (string.IsNullOrEmpty(resourceType))
            {
                throw new ArgumentNullException("resourceType", Properties.Resources.EXCEPTION_ARGUMENTINVALID);
            }

            ResourceType  typeInfo  = new CoreHelper(connectionString).GetResourceType(resourceType);
            List <string> hierarchy = new CoreHelper(connectionString).GetResourceTypeHierarchy(typeInfo);
            string        typeName  = hierarchy.Find(typeOf => typeOf.Equals("ScholarlyWork", StringComparison.OrdinalIgnoreCase));

            if (string.IsNullOrEmpty(typeName))
            {
                return(false);
            }

            return(true);
        }