Best practice when returning an array of values (.NET)

后端 未结 8 924
灰色年华
灰色年华 2021-01-14 14:37

Usually my methods are as the following:

public List Method1(int input)
{
    var output = new List();
    //add some items to output
          


        
8条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 15:07

    IEnumerable / IEnumerable unless you specifically need a list, then you should return IList

提交回复
热议问题