+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / IList syntax issue... GetContent...

IList syntax issue... GetContent...

3 posts, 1 answered
  1. TIOS
    TIOS avatar
    48 posts
    Registered:
    22 Mar 2006
    10 Jan 2011
    Link to this post
    Hi,

    Busy converting some code from vb.net to c#, in vb i had the following code:

    Private _Items As IList

    Converting this to c# this looks like:

    private IList _Items;

    This fails to compile however though keep getting the following message:
    Error   9   Using the generic type 'System.Collections.Generic.IList<T>' requires 1 type arguments

    I've tried private IList<Telerik.Cms.Engine.IContent> _Items; but can't get it to work the function that populates this is (not even sure if this is the correct thing to put).  Looking at the documentation all examples show it without <> brackets:

    private void PopulateFilteredIList()
    {
        Telerik.Libraries.LibraryManager libManager = new Telerik.Libraries.LibraryManager();
        Telerik.Cms.Engine.IMetaSearchInfo[] filter = null;
        string filterExpr = "AuctionId = '" + AuctionIdToShow + "'";
        filter = libManager.GetFilter(filterExpr);
        _Items = libManager.GetContent(filter);
    }

    Any ideas how to get this compile as this is my last one to convert to c# now!

    Thanks,
    Chris
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Jan 2011
    Link to this post
    Hello Chris,

    Add using System.Collections instead of using System.Collections.Generic

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. TIOS
    TIOS avatar
    48 posts
    Registered:
    22 Mar 2006
    10 Jan 2011
    Link to this post
    Thanks Ivan, you're a star didnt even occur to me it could be the wrong namespace!

    Thanks,
    Chris
Register for webinar
3 posts, 1 answered