InternetException

generics

generics · 3 posts (all tags)

.NET/C# interview questions

· 146 words · ~1 min read · updated · in .NET, interview

#generics #reflection #async #Entity Framework

Read the whole thing →

.NET Generics

· 75 words · ~1 min read · in .NET, interview

#generics

Allow for:

  • generalization of logic based on available types
  • specify possible supported types
  • re-usability of code
  • type safety
  • defers the exact specification of logic until the class or method is declared and instantiated by user code with all type parameters specified
  • mostly used for collections (some non-generic versions of collection are not recommended like ArrayList i.e.)
  • information of exact type parameters used in a generic can be obtained at runtime by reflection

Further read:

Read the whole thing →

Faster than Reflection: Delegates. Part 3.

· 6868 words · ~34 min read · updated · in .NET, C#

#delegates #reflection #generics #NuGet

This is third article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous articles and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read first two. If you are just looking for a way to create delegates for methods or constructors it is not necessary. Code with new features and with bug fixes is available on GitHub and as Nuget package.

Read the whole thing →