/// <summary>
        /// Convenience method to retrieve an object derived from the TypeProjection class, using its FullName
        /// </summary>
        /// <typeparam name="T">TypeProjection derived type</typeparam>
        /// <param name="authToken">AuthorizationToken to use</param>
        /// <param name="name">FullName to find</param>
        /// <returns></returns>
        internal static async Task <T> GetByFullName <T>(AuthorizationToken authToken, string name) where T : TypeProjection
        {
            QueryCriteriaExpression expr = new QueryCriteriaExpression
            {
                PropertyName = "FullName",
                PropertyType = QueryCriteriaPropertyType.GenericProperty,
                Operator     = QueryCriteriaExpressionOperator.Equal,
                Value        = ClassConstants.GetClassNameByType <T>() + ":" + name
            };

            QueryCriteria criteria = new QueryCriteria(TypeProjectionConstants.GetProjectionIdByType <T>())
            {
                GroupingOperator = QueryCriteriaGroupingOperator.SimpleExpression
            };

            criteria.Expressions.Add(expr);

            List <T> retList = await GetByCriteria <T>(authToken, criteria);

            if (retList.Count == 0)
            {
                return(null);
            }
            else if (retList.Count == 1)
            {
                return(retList[0]);
            }
            else
            {
                throw new CiresonApiException("More than one item found with identical full name");
            }
        }
        /// <summary>
        /// Creates a new TypeProjection of derived type T and returns it
        /// </summary>
        /// <typeparam name="T">TypeProjection derived type</typeparam>
        /// <param name="authToken">AuthorizationToken to use</param>
        /// <returns></returns>
        internal static async Task <T> CreateBlankObject <T>(AuthorizationToken authToken, string name, string displayName, dynamic objProps = null) where T : TypeProjection
        {
            // See if we have a CI matching this name first
            T item = await GetByFullName <T>(authToken, name);

            if (item != null)
            {
                string fullName = ClassConstants.GetClassNameByType <T>() + ":" + name;
                throw new CiresonDuplicateItemException("An object by the name " + fullName + " already exists.");
            }

            // Setup the CI
            dynamic ci = new ExpandoObject();

            ci.formJson          = new ExpandoObject();
            ci.formJson.isDirty  = true;
            ci.formJson.original = null;

            ci.formJson.current             = new ExpandoObject();
            ci.formJson.current.BaseId      = null;
            ci.formJson.current.ClassTypeId = ClassConstants.GetClassIdByType <T>();
            ci.formJson.current.ClassName   = ClassConstants.GetClassNameByType <T>();
            ci.formJson.current.Name        = name;
            ci.formJson.current.DisplayName = displayName;
            ci.formJson.current.TimeAdded   = "0001-01-01T00:00:00";

            //ci.formJson.current.ObjectStatus = new ExpandoObject();
            //ci.formJson.current.ObjectStatus.Id = EnumerationConstants.TypeProjection.BuiltinValues.ObjectStatus.Active;

            // Merge another property object in
            if (objProps != null)
            {
                IDictionary <string, object> ciDict = (IDictionary <string, object>)ci.formJson.current;

                foreach (var property in objProps.GetType().GetProperties())
                {
                    if (property.CanRead)
                    {
                        ciDict[property.Name] = property.GetValue(objProps);
                    }
                }
            }

            // Create the new TypeProjection, then return the full-property object
            T newCI = await CreateObjectFromData <T>(authToken, ci);

            return(await GetByBaseId <T>(authToken, newCI.BaseId));
        }