How do I create and access a new instance of an Anonymous Class passed as a parameter in C#?
- 阅读更多 关于 How do I create and access a new instance of an Anonymous Class passed as a parameter in C#?
问题 I have created a function that takes a SQL command and produces output that can then be used to fill a List of class instances. The code works great. I've included a slightly simplified version without exception handling here just for reference - skip this code if you want to jump right the problem. If you have suggestions here, though, I'm all ears. public List<T> ReturnList<T>() where T : new() { List<T> fdList = new List<T>(); myCommand.CommandText = QueryString; SqlDataReader nwReader =