Exemplo n.º 1
0
        public ObjectDefinition GetDefinition <T>()
        {
            string requestId;
            ObjectDefinitionRequest request = new ObjectDefinitionRequest();

            request.ObjectType = typeof(T).Name;
            var defs = _client.Describe(new ObjectDefinitionRequest[] { request }, out requestId);

            return(defs[0]);
        }
Exemplo n.º 2
0
        public IList <string> GetRetrivableProperties(string type)
        {
            Type apiObjectType = typeof(ETService.APIObject);
            Type et            = Type.GetType(apiObjectType.Namespace + "." + type);

            string[] excludedProperties = new string[] {
                "IsHTMLPaste"
            };
            string requestID;
            ObjectDefinitionRequest objDefs = new ObjectDefinitionRequest();

            objDefs.ObjectType = et.Name;

            ObjectDefinition[] definitions = _client.Describe(new ObjectDefinitionRequest[] { objDefs }, out requestID);


            var retrievables = (
                from p in definitions[0].Properties
                where p.IsRetrievableSpecified && p.IsRetrievable
                select p.Name
                ).Except(excludedProperties).ToList();

            return(retrievables);
        }