Posts

Token Authentication

.Net Core 2.0 and Dockers

Core examples with PPT

WCF Client to Service call

Download Project I am using a channel factory to call WCF service from client side in this example . A Channel Factory enables you to create a communication channel to the service without a proxy. A Channel Factory is implemented by the IChannelFactory Interface and their associated channels are used by the initiators of a communication pattern. The Channel Factory class is useful when you want to share a common service contract DLL between the client and the server.

Design Patterns - SOLID

Download          The SOLID principles of Object Oriented Design include these five principles:         1. SRP – Single Responsibility Principle.         2. OCP – Open/Closed Principle.         3. LSP – Liskov Substitution Principle.         4. ISP – Interface Segregation Principle.         5. DIP – Dependency Inversion Principle.         1 .SRP – Single Responsibility Principle.              This means that every class, or similar structure, in your code should have only one job to do.             The Single Responsibility Principle is one of the SOLID design principles.We can define it in the following ways :-             1. A reason to change: - A class or method should have only one reason to change.             2. Single Responsibility :- A class or method should have only a single responsibility.             SRP Benefits:-             The SRP has many benefits to improve code complexity and maintenance.Some benefits of SRP are following,             1. Redu
   what is delegate:- A delegate is like a pointer to a function.  It is a reference type data type and it holds the reference of a method.  All the delegates are implicitly derived from  System.Delegate class. A function can have one or more parameters of different data types, but to pass a function as a parameter, delegate is used   Syntax:-       A delegate can be declared using  delegate  keyword followed by a function signature as       shown below. Delegate Syntax:           <access modifier> delegate <return type> <delegate_name>(<parameters>)    E.g:-         public delegate void Print( int value ); Example: C# delegate class Program {     // declare delegate     public delegate void Print( int value );     static void Main( string [] args)     {         // Print delegate points to PrintNumber         Print printDel = PrintNumber;                 // or         // Print printDel = new

Desgin Pattern - Factory Design pattern

       Download Factory Design Project

Design Patterns - Singleton pattern

Download Singleton project

JWT - Token based authentication

Image
Download JSON Web Token  ( JWT ) with  Web API . The modern approach for authenticating a user is through  token  based  authentication  scheme. It relies on signed  tokens  which are sent by user to server with each request.  you put all claims in json web structure. you sign structure using asymmetric key and encode whole thing in Base64. validating signature,issuer and audience 

Token Based Authentication - OWIN & JWT

Image
Download Project

WEB API CALL FROM CLIENT MVC C#

Download _________________________________________________________________________________ Step1: create [MVC client project] Step2:// User.cs [Model class]  public class User     {         public string UserName { get; set; }         public string Password { get; set; }     } Step3://CALLPACKAGE.cs class   public class CallPackage     {         public CallPackage()         {             Encoding = DefaultEncoding;             EndPointUrl = string.Empty;             Parameters = string.Empty;             Method = HttpVerbs.Get;             ContentType = "application/json";             PostData = string.Empty;         }         public CallPackage(string endpointUrl)             : this()         {             EndPointUrl = endpointUrl;         }         public CallPackage(string endpoint, HttpVerbs method)             : this(endpoint)         {             Method = method;         }         public CallPackage(string endpoint, HttpVerbs method