Esempio n. 1
0
        /// <summary>
        /// Create a new entity object. This object is not saved to the server until you call Insert with it.
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <returns></returns>
        public TEntity Create <TEntity>() where TEntity : ParaEntityBaseProperties, new()
        {
            var entity = new TEntity();
            var ar     = ApiCallFactory.ObjectGetSchema <TEntity>(Credentials);

            if (ar.HasException == false)
            {
                var purgedSchema = ApiUtils.RemoveStaticFieldsNodes(ar.XmlReceived);
                entity = ParaEntityParser.EntityFill <TEntity>(purgedSchema);
            }

            entity.ApiCallResponse = ar;
            return(entity);
        }