How to create a property for a List

前端 未结 6 618
春和景丽
春和景丽 2020-12-13 00:32
private List newList;

public List NewList
{
get{return newList;}
set{newList = value;}
}

I want to create something like this, b

6条回答
  •  悲哀的现实
    2020-12-13 01:04

    You could do this but the T generic parameter needs to be declared at the containing class:

    public class Foo
    {
        public List NewList { get; set; }
    }
    

提交回复
热议问题