As described here , dynamics can simplify the use of underdeveloped external libraries: Microsoft provides an example of Microsoft.Office.Interop.Excel. And with dynamics, you can avoid a lot of annoying explicit actuation when using this assembly.
In addition, unlike @ user2415376, this is definitely not a way to handle interfaces, since we already have Polymorphism implemented from the first days of the language!
you can use
ISomeData specificData = data;
instead
dynamic specificData = data;
In addition, it will make sure that you are not passing the wrong type of data object.
Ashkan Sirous Jan 23 '17 at 9:10 2017-01-23 09:10
source share