Search code examples
c#.netilist

Creating a class field of type IList<>?


I'm trying to create a POCO object called Friend.cs. I can't seem to create inline properties for the IList.

public class User
    {
        public string ID { get; set; }
        public string Name { get; set; }
        public string Rating { get; set; }
        public string Photo { get; set; }
        public string Reputation { get; set; }
        public string Group { get; set; }
        public string GroupColor { get; set; }
        public string PostCount { get; set; }
        public string PostPerDay { get; set; }
        public string JoinDate { get; set; }
        public string Views { get; set; }
        public string LastActive { get; set; }
        public string Title { get; set; }
        public string Age { get; set; }
        public string Birthday { get; set; }
        public string Sex { get; set; }
        public string LinkedIn { get; set; }
        public string Facebook { get; set; }
        public string Twitter { get; set; }
        public IList<Friend> {get???
}

Thanks for the help!


Solution

  • You forget the name of the property:

    public IList<Friend> Friends {get; set;}
    

    should work.