0

I just came across this snippet where the thread opener used

public static dynamic GetAccessToken()

I found out what it is good for and that it was implemented in C# 4.0 but I could not find an equivalent in vb.net. Is it just Object or is there something else that suits better?

ruedi
  • 5,365
  • 15
  • 52
  • 88
  • 2
    @mason No, `dynamic` is *not* an `ExpandoObject`. `dynamic` is just a way of turning off static typing. `ExpandoObject` is an object that's more useful when there isn't static typing. You can still use `dynamic` with any other object, and `ExpandoObject` without using `dynamic`. – Servy Apr 18 '18 at 15:10
  • @Servy Thanks for the correction. I tend to avoid dynamic myself as much as possible. – mason Apr 18 '18 at 15:20
  • The equivalent *is* using 'Object' with Option Strict Off. The 'dynamic' keyword was added to C# to replicate this VB 'feature' in C#. – Dave Doknjas Apr 18 '18 at 18:11

0 Answers0