If you dealt with Type API in .NET 4.5, you must have already found that there is a separate object that exists that subsets the Type object into a more lightweight object representation that provides metadata specific to a particular Type called here as TypeInfo. It is quite easy to deal with TypeInfo rather that the Type object… Read More »
Couple of days back we have discussed about one of the hidden and very useful code snippet, ‘propfull – for property and backing field’. Today you will learn another interesting code snippet ‘forr’. Yes, you read it correctly ! ‘forr’ . You must be familiar with ‘for’ code snippet that generates basic for-loop structure. Where as, ‘forr’ generates the… Read More »
.NET 4.5 comes with some of the major enhancements. Among them, one of the most important changes that has been made to every object is with the metadata of objects. In .NET 4.5 the System.Type object has been split into two separate classes: Type : Provides a shallow view of the object structure, and mainly used to hold… Read More »
Do you know that .NET GC now equipped with yet another option to Compact Large Object Heap. This has been a long problem for people where LOH can produce fragmentation in memory or when Free space table cannot handle allocation requests. LOH is the Large object Heap allocated generally for large objects which are above 85,000 bytes long.… Read More »
Once stuck on a requirement where I needed to write a code which is flexible and generic enough to sort any type of collection and also the property based on which it has to be sorted will be dynamic. After trying many options I discovered myself how easy it is to hit this requirement using Lamda Expression.
You are writing one application in Visual Studio which accepts some command line parameter to do some operation. You pass command line arguments to the program when it’s been invoked from the command line. But how did you do it from Visual Studio ? You want to test your application and do you really want to open command… Read More »
In this tip I will discuss how we can get assembly version programmatically from a caller application. This can be done easily by taking help of Reflection. Assembly Class contains a static method called GetAssemblyFullName() which gets the assembly that contains the code that is currently executing.
Most of us are very familiar with Dictionary Collection which supports only one value per key mapping. But, what if, if you came across with some situation where you need to map keys with collection of elements ? Do we really need to create a custom collection ? I will say, NO. C# provides another Collection type called… Read More »