dynamic keyword : These Object type need not be known till runtime. Member's signature is not know till it is executed. E.g. System.Reflection Programming against COM IDispatch Programming against XML or HTML DOM Dynamic Language Runtime (DLR) behaves more like Python or Ruby. Dynamic in C# is a type for e.g. Dynamic WildThings(dynamic beast, string name) { Dynamic whatis = beast.Wildness(name); … .. return whatsits; } dynamic : statically declared on object type, when object is marked to be dynamic that object is recognized by the compiler and it replaces the object metadata to be used during runtime, the runtime then check to resolve the call which would be invoked either as dynamic dispatch or throws runtime error. dynamic != var Var keyword is used for type inference and compile time check is made. Dynamic keyword is used for object that is unknown during compilation and hence compile time check is not made. dynamic cannot be used for Extension methods dynamic methods invocation cannot use anonymous methods as parameter. dynamic heisenberg; Void LocationObserver(float x, float t) {} Heisenberg.Observer(LocationObserver); --> right way of using call Heisenberg.Observer(delegate (float y, float t){});--> wrong way of using call Heisenberg.Observer((x,t)=>x+t);--> wrong way of using call dyanmic objects cannot be used in LINQ. Dynamic collection = {1,2,4,5 ,6, 7,8} Var result = collection.Select(e=>e.size>25)


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials