Example #1
0
        protected string GetCustomFieldsValue(BaseIntegrationObject o, string field)
        {
            if (o.CustomFields == null)
            {
                return(string.Empty);
            }
            var res = o.CustomFields.FirstOrDefault(f => f.Name == field);

            if (res != null)
            {
                return(res.Value ?? string.Empty);
            }
            return(string.Empty);
        }
Example #2
0
        protected Guid?GetCustomFieldsGuidValue(BaseIntegrationObject o, string field)
        {
            var guid = Guid.Empty;

            if (o.CustomFields == null)
            {
                return(null);
            }
            var res = o.CustomFields.FirstOrDefault(f => f.Name == field);

            if (res != null)
            {
                if (Guid.TryParse(res.Value ?? string.Empty, out guid))
                {
                    return(guid);
                }
            }
            return(null);
        }