Esempio n. 1
0
        public Models.Attribute FindAttributeByTitle(string projectId, string attributeTitle, List <Entry> attributes = null)
        {
            if (attributes == null)
            {
                attributes = Query(projectId, ObjectTypes.Attribute);
            }
            if (attributes == null)
            {
                return(null);
            }
            attributes = attributes.FindByTitle((attributeTitle ?? "").Trim());

            var url      = Url.Combine(Config.Url, attributes.First().Link);
            var response = GetRequest(url);
            var settings = new JsonSerializerSettings();

            settings.Converters.Add(new BoolConverter());
            var attributeResponse = JsonConvert.DeserializeObject(response, typeof(AttributeResponse), settings) as AttributeResponse;

            return(attributeResponse.Attribute);
        }
Esempio n. 2
0
 public Models.Attribute FindAttributeByTitle(string projectId, string attributeTitle, List<Entry> attributes = null)
 {
     if (attributes == null)
         attributes = Query(projectId, ObjectTypes.Attribute);
     if (attributes == null)
         return null;
     attributes = attributes.FindByTitle((attributeTitle ?? "").Trim());
     return GetAttributeByUri(attributes.First().Link);
 }
Esempio n. 3
0
        public Models.Attribute FindAttributeByTitle(string projectId, string attributeTitle,  List<Entry> attributes=null)
        {
            if (attributes == null)
                attributes = Query(projectId, ObjectTypes.Attribute);
            if (attributes == null)
                return null;
            attributes = attributes.FindByTitle((attributeTitle ?? "").Trim());

            var url = Url.Combine(Config.Url, attributes.First().Link);
            var response = GetRequest(url);
            var settings = new JsonSerializerSettings();
            settings.Converters.Add(new BoolConverter());
            var attributeResponse = JsonConvert.DeserializeObject(response, typeof (AttributeResponse),settings) as AttributeResponse;
            return attributeResponse.Attribute;
        }