public static XElement GetListXml(string id, SubjectRelatedListFilterData filter)
        {
            XElement obj = null;

            CreateCoreServiceClient().Using(client =>
            {
                try
                {
                    obj = client.GetListXml(id, filter);
                }
                catch (Exception e)
                {
                    obj = null;
                }
            });
            return(obj);
        }
        public static IList <T> GetList <T>(string id, SubjectRelatedListFilterData filter) where T : IdentifiableObjectData
        {
            IList <T> obj = null;

            CreateCoreServiceClient().Using(client =>
            {
                try
                {
                    obj = client.GetList(id, filter).Cast <T>().ToList();
                }
                catch (Exception e)
                {
                    obj = null;
                }
            });
            return(obj);
        }
Exemple #3
0
        public List <T> GetList <T>(string id, SubjectRelatedListFilterData filterData = null) where T : class
        {
            if (_client == null)
            {
                return(default(List <T>));
            }

            object[] obj  = null;
            List <T> list = new List <T>();


            try
            {
                if (filterData == null)
                {
                    filterData = new SubjectRelatedListFilterData {
                    }
                }
                ;

                if (typeof(T) == typeof(XmlListItemData))
                {
                    XElement element = _client.GetListXml(id, filterData);

                    list = XmlListItemData.GetListOf(element) as List <T>;
                }
                else
                {
                    obj = _client.GetList(id, filterData);

                    if (obj != null && obj.Length > 0)
                    {
                        list = obj.OfType <T>().ToList();
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error("GetList<" + typeof(T).Name + ">", e);
                throw;
            }

            return(list);
        }
Exemple #4
0
        public List <T> GetList <T>(string id, SubjectRelatedListFilterData filterData = null) where T : class
        {
            object[] obj  = null;
            List <T> list = new List <T>();

            CoreService().Using(client =>
            {
                try
                {
                    if (filterData == null)
                    {
                        filterData = new SubjectRelatedListFilterData {
                        }
                    }
                    ;

                    if (typeof(T) == typeof(XmlListItemData))
                    {
                        XElement element = client.GetListXml(id, filterData);

                        list = XmlListItemData.GetListOf(element) as List <T>;
                    }
                    else
                    {
                        obj = client.GetList(id, filterData);

                        if (obj != null && obj.Length > 0)
                        {
                            list = obj.OfType <T>().ToList();
                        }
                    }
                }
                catch (Exception e)
                {
                    throw;
                }
            });

            return(list);
        }
Exemple #5
0
 public IdentifiableObjectData[] GetList(string id, SubjectRelatedListFilterData filter)
 {
     return(_client.GetList(id, filter));
 }
Exemple #6
0
 public XElement GetListXml(string id, SubjectRelatedListFilterData filter)
 {
     return(_client.GetListXml(id, filter));
 }
 public XElement GetListXml(string tcmUri, SubjectRelatedListFilterData filter)
 {
     return this.Client.GetListXml(tcmUri, filter);
 }
 public IdentifiableObjectData[] GetList(string tcmUri, SubjectRelatedListFilterData filter)
 {
     return this.Client.GetList(tcmUri, filter);
 }