Return Anonymous Type from a function

前端 未结 6 999
庸人自扰
庸人自扰 2020-12-16 11:05

Can I use an anonymous type as a return type in a Function, and then stuff that returned value into an array or collection of some sort whilst also adding an additional fiel

6条回答
  •  不思量自难忘°
    2020-12-16 11:48

    Just use and ArrayList

        public static ArrayList GetMembersItems(string ProjectGuid)
        {
            ArrayList items = new ArrayList(); 
    
                  items.AddRange(yourVariable 
                            .Where(p => p.yourproperty == something)
                            .ToList());
                return items;
        }
    

提交回复
热议问题