Dictionary and HashTable in C#

      No Comments on Dictionary and HashTable in C#

.NET Framework provides several data structures for constant O(1) access. In software engineering we call them lookup tables. In .NET we can list following lookup-tables (at least): HashTable Dictionary ConcurrentDictionary HybridDictionary Sample code Code samples are taken from MSDN documentation and adjusted to better explain the context. HashTable Dictionary As… Read more »

Func vs Expression

      1 Comment on Func vs Expression

This is another post about C# basics 🙂 Our code sample is like following: What we have here is Func ‘f’ and Expression ‘e1’ initialized with same value (x, y) => (x + y) * 2 Lines 21,22 and 23 will all print the same output: 6. So what is… Read more »

Throwing exception in C#

      1 Comment on Throwing exception in C#

In C# there are 3 of ways to throw exception. throw throw ex throw new Exception(“message”, innerException) Our sample: I will make changes in line 30 (purple box) and catch exception in parent method in simple try{} catch(Exceptiop e){} block. Method throwing actual exception is called ThrowExceptionMethod() and is not… Read more »

NDepend VSTS Extension

      No Comments on NDepend VSTS Extension

NDepend was recently released as VSTS Extension. Before that it was available as separate application. It was (and still is) to run it as task on CI server (eg. TeamCity) NDepend VSTS Extension can be installed from https://marketplace.visualstudio.com/items?itemName=ndepend.ndependextension. After installation new option is available in menu The only thing to… Read more »