Category Archives: .NET

Design Patterns in Sofware Development

By | March 1, 2019

Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs, creation of objects and interactions of objects. Design Patterns can be broadly categorized in following three categories Creational Design Pattern Factory Method Abstract Factory Builder Prototype Singleton Structural Design Patterns Adapter Bridge Composite… Read More »

Generics at the Run Time in C#

By | August 25, 2018

When a generic type or method is compiled into Microsoft intermediate language (MSIL), it contains metadata that identifies it as having type parameters. How the MSIL for a generic type is used differs based on whether the supplied type parameter is a value type or reference type. When a generic type is first constructed with… Read More »

What is a constraint on generics in C#

By | August 25, 2018

Generics make it possible to design classes and methods that defer the specification of one or more types until the class or method is declared and instantiated by client code. For example, by using a generic type parameter T you can write a single class that other client code can use without incurring the cost… Read More »

What is private protected access modifier

By | November 22, 2017

Finally, with C# 7.2 we get a new compound access modifier: private protected indicates that a member may be accessed by derived classes that are declared in the same assembly. While protected internal allows access by derived classes or classes that are in the same assembly, private protected limits access to derived types declared in… Read More »

What is an in parameter in C#

By | November 22, 2017

C# 7.2 adds the in keyword to complement the existing ref and out keywords when you write a method that passes arguments by reference. The in keyword specifies that you are passing the parameter by reference and the called method does not modify the value passed to it. This addition provides a full vocabulary to… Read More »

How to use Azure AD Authentication in web application

By | November 13, 2017

When you want to use Azure Active Directory Authentication in your web application, you have two choices. One when you create your application that time itself you can provide the organization details and Visual Studio will do the rest of the work for you. In background Visual Studio will create application registration for your newly… Read More »

When to use Static Constructor?

By | September 10, 2017

A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed once only. It is called automatically before the first instance is created or any static members are referenced. class SimpleClass { // Static variable that must be initialized at run time.  static readonly long baseline; //… Read More »