DESIGN PATTERN

According to Gang of Four, it defines a chain of responsibilities to process a request. In other words, pass the request from one object to another until an object accepts its responsibility.

Photo by Miguel Á. Padriñán from Pexels

Use Case

100–1000 Rs => Junior/Senior Engineers => Approved by Manager1001–10000 Rs => Managers => Approved by Senior Manager
public class Claim{
public int Id{get;set;}
public double amount{get;set;}
}

Prerequisites

  • Basic knowledge of OOPS concepts.
  • Any…


C# CONCEPTS

According to Gang of Four, a creational pattern “Builder” allows to separate and reuse a specific method to build something.

Photo by Andrea Piacquadio from Pexels

Use Case

public class Car{
public string Name { get; set; }
public double TopSpeed { get; set; }
public bool IsSUV { get; set; }
}

Prerequisites

  • Basic knowledge of OOPS concepts.
  • Any programming language knowledge.

Learning Objectives

  • How to…


.NET CODE ANALYSIS

How to run SonarQube locally for .Net solutions

Photo by Jefferson Santos on Unsplash

Prerequisites

  1. Download the SonarQube free Community Edition
  2. SonarQube scanners require version 8/11 of the JVM, and the SonarQube requires version 11
  3. Install PostgreSQL for demonstration, but it also supports MSSQL and Oracle databases.
  4. For the .Net Core 2+ version, download SonarQube Scanner.
  5. For the .Net Framework version, download SonarQube Scanner.

Getting Started

Configure User


C# CONCEPTS

According to Gang of Four, the Mediator pattern encapsulates the object interaction with each other.

Use Case

David to Scott: 'Hey'
Scott to David: 'I am good how about you.'
Jennifer to Ashley: 'Hey ashley... david is back in the group'
Jennifer to David: 'Where have you been?'
Ashley to David: 'How come you aren't active here anymore?'

Prerequisites

  • Basic knowledge of OOPS concepts.
  • Any programming language knowledge.


C# CONCEPTS

C# compiler allows using interfaces generic types.

Photo by Sora Shimazaki from Pexels

Learning Objective

  • How to create generic interfaces of type T
  • How to implements a generic interface in a non-generic class
  • How to implements a generic interface in a generic class

Prerequisites

Getting Started

public interface ITest<T> { }
public interface ITest<T> {
List<T> GetList();
}
public interface ITest<T, U>{
List<T> GetList(U value);
}


C# CONCEPTS

According to Gang of Four, the Adapter Pattern converts the interfaces of a class into interfaces that the client requires.

Photo by Brett Sayles from Pexels

Use Case

Prerequisites

  • Basic knowledge of OOPS concepts.
  • Any programming language knowledge.

Learning Objectives

  • How to code using an adapter…


MSSQL

The error occurs as a result of connection leaks in the application.

Photo by panumas nikhomkhai from Pexels
Message=Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and the max pool size was reached.
select count(1) conection_count, program_name, host_name, status, host_process_id from sys.dm_exec_sessions where is_user_process = 1 group by program_name, host_name, status, host_process_id order by 1 desc

C# CONCEPTS

According to Gang of Four, observer pattern defines dependency b/w two or more objects. So when one object state changes, then all its dependents are notified.

Photo by Christina Morillo from Pexels

Use Case

Prerequisites

  • Basic knowledge of OOPS concepts.
  • Any programming language knowledge.

Learning Objectives

  • How to code using an observer design pattern?

Getting Started


VISUAL STUDIO TIPS

Edit multiple lines of code at the same time

Tip 1: Box Selection

public class Test {
int x = 10;
int y = 20;
int z = 30;
int l = 40;
}

Shortcut Key: “Shift + Alt + down arrow (to select multiple rows).”

Isn’t it great..!!

Example: “.html” file


VISUAL STUDIO TIPS

Cool visual studio tips for productivity

Photo by Shotkit from Pexels

What is Brace Matching?

Sukhpinder Singh

Programmer by heart | C# | Python | .Net Core | Xamarin | Angular | AWS | Remember to 👏👏👏👏 Buy me a coffee https://www.buymeacoffee.com/sukhpindersingh

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store