Code First
All Articles

Using Code First first

Traditional ways of software development focus on DB-first implementation methodology. But we are in the realm of latest developments and ORM models has taken us to a level that is was a complex ordeal some years back. Eventhough a thorough domain/ERD based approach provides some advantages, there are far more overall improvements to development and…

All Articles

Using Extension Methods in C#

Extension methods are a way to add methods to a class without changing its source code or adding it into a derived class. Creating extension methods example Define extension method – public static class StringExtensions     {         public static string Reduce(this String str, int numOfWords)         {             if (numOfWords <= 0)                 return str;             var numWords = str.Split(‘ ‘);             if (numOfWords >= numWords.Length)                 return str;             return String.Join(” “, numWords.Take(numOfWords));         }     } Shorten is an extension class on the String class. Adding as above, we were able…

All Articles

C# Events and Delegates

We use events and delegates to extend applications and to implement loose coupling. Rather than adding various method calls within an implementation and then recompiling the class, we publish the need to call a set of methods as an event from the class that will invoke those methods (publisher). The publisher will thus define the delegate which will act…

All Articles

Using C# Delegates

  Delegates is a way to support addition of multiple features (eg: methods) to a framework without the need to recompile the core class that uses these methods. Delegate is a reference to a function/s and is itself an object (derived from MulticastDelegate) that knows how to call a method or group of methods. The…

All Articles

Preferred Multithreading in C# ASP.NET

Parallel execution has been one of the core techniques of programming languages that enables and stabilizes the heavy orchestrated flow of information across information management systems. All Object Oriented Programming languages provides couple different ways to implement this to function smoothly under heavy and stressful load 🙂 A better way was introduced in C# which…