c# - sitapriyanka/aws GitHub Wiki

  • Q. What is a Closure

  • A. closure in C# takes the form of an in-line delegate/anonymous method. A closure is attached to its parent method meaning that variables defined in parent's method body can be referenced from within the anonymous method.

  • Q. What is implicit operator?

  • A. implicit operator is a type conversion operator that has an implicit keyword and does user defined type conversions. takes a class as input and returns a value so just by using the type will get the value. it is a syntactic sugar.

Q. XMLSerializer has a default limitation that it will not serialize a property that does not have a setter. Same case with DataContratSerializer. DataContract serializer - if a property that doesn't have a setter is decorated with DataContract attribute then dotnet rintime throws an excpetion.

Q. Whenever a delegate is defined with delegate keyword, the compiler will creates a class that derives from a multicast delegate which in turn derives from delegate class. System. Delegate is the base class for all delegates.

Q. Deffered execution? A. Differed execution means - evaluation of the expression is actually delayed until its result is actually required. also called lazy evaluation. only one item in the list is processed in a single iteration. Early evaluation is processing all the list once ..for example to compile Orderby() list has to evaluate all elements at once. ToList() and ToArray() are used for early evaluation.