What is the difference between myCustomer.GetType() and typeof(Customer) in C#?

后端 未结 7 1211
渐次进展
渐次进展 2020-12-02 07:11

I\'ve seen both done in some code I\'m maintaining, but don\'t know the difference. Is there one?

let me add that myCustomer is an instance of Customer

7条回答
  •  情歌与酒
    2020-12-02 07:31

    For the first, you need an actual instance (ie myCustomer), for the second you don't

提交回复
热议问题