What's the return type of an anonymous class

前端 未结 7 2358
再見小時候
再見小時候 2020-12-11 09:28

I have a class that used to have a string return type. Now I find I need to return more than a string. I was thinking to return something like below:

public          


        
相关标签:
7条回答
  • 2020-12-11 10:32
    class NewString
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }
    
    public NewString Test()
    {
        return ( new NewString() { ID = 5, Name = "Dave" } );
    }
    

    :)

    0 讨论(0)
提交回复
热议问题