Saturday, 11 November 2023

CQRS pattern

CQRS, or Command Query Responsibility Segregation, is a design pattern that separates the responsibilities of reading and writing data in a software system. Here’s a breakdown of its key concepts:

Key Concepts

  1. Separation of Concerns:

    • Commands: These are actions that change the state of the system (e.g., creating, updating, or deleting data). They do not return data.
    • Queries: These are operations that retrieve data without altering the system’s state. They are designed for read operations.

Here's a simple example of implementing the CQRS pattern in C#:

 // Command
public class CreateProductCommand
{
    public string Name { get; set; }
    public decimal Price { get; set; }
}

// Command Handler
public class CreateProductCommandHandler
{
    public void Handle(CreateProductCommand command)
    {
        // Logic to create a new product and update the state
        // This might involve validation, persistence, and other business logic

        Console.WriteLine($"Product '{command.Name}' created successfully with price {command.Price}");
    }
}

// Query
public class GetProductQuery
{
    public int ProductId { get; set; }
}

// Query Handler
public class GetProductQueryHandler
{
    public Product Handle(GetProductQuery query)
    {
        // Logic to retrieve product information from the state
        // This might involve querying a database, caching, or other mechanisms

        return new Product
        {
            ProductId = query.ProductId,
            Name = "Sample Product",
            Price = 29.99m
        };
    }
}

// Model
public class Product
{
    public int ProductId { get; set; }
    public string Name { get; set; }
    public decimal Price { get; set; }
}

// Example Usage
class Program
{
    static void Main()
    {
        // Command side usage
        var createProductCommand = new CreateProductCommand
        {
            Name = "Example Product",
            Price = 49.99m
        };

        var createProductHandler = new CreateProductCommandHandler();
        createProductHandler.Handle(createProductCommand);

        // Query side usage
        var getProductQuery = new GetProductQuery
        {
            ProductId = 1
        };

        var getProductHandler = new GetProductQueryHandler();
        var product = getProductHandler.Handle(getProductQuery);

        Console.WriteLine($"Product Name: {product.Name}, Price: {product.Price}");
    }
}

In this example, the CreateProductCommand represents a command for creating a new product, and the CreateProductCommandHandler handles this command, updating the system state accordingly. On the query side, the GetProductQuery represents a query to retrieve product information, and the GetProductQueryHandler handles this query, providing the necessary data from the system state. The Product class is a simple model representing a product.

Benefits:

  • Scalability: By separating reads and writes, you can optimize each side independently. For instance, you might use different data stores or caching mechanisms for reading.
  • Performance: Read and write models can be tailored for their specific tasks, potentially improving performance.
  • Flexibility: Allows for different data models for reads and writes, which can simplify complex domains.

Reference: https://www.c-sharpcorner.com


Continue Reading →

MicroService Interview Q/A

What is a Microservice?

Microservices are an architectural style that involves breaking down a large application into a collection of loosely coupled services that communicate over well-defined APIs. Each microservice is designed to perform a specific business function and can be developed, deployed, and scaled independently.

What are the key characteristics of Microservices?

  1. Loose Coupling : Microservices operate independently of each other. It can be developed, deployed, and scaled independently.
  2. Single Responsibility Principle: Each service should have a single responsibility and focus on a specific business capability.
  3. Resilience: Failure in one service does not affect others.
  4. Scalability: Each service can be scaled independently.
  5. Decentralized Data Management: Each service manages its own database.

How do Microservices communicate with each other?

Microservices commonly communicate through lightweight protocols such as HTTP/REST, or message queues like RabbitMQ or Apache Kafka.

What is the difference between Microservices and Monolithic architecture?

In a monolithic architecture, all components of the software are tightly linked and run as a single service. This means that any changes made to even a small part of the application could affect the whole system.

In contrast, microservices architecture breaks down the application into smaller, independent services that run their own processes and communicate via well-defined APIs. This independence allows for easier scaling, more resilience, and faster deployment cycles.

Explain the concept of Service Discovery in Microservices.

Service discovery in microservices refers to the process by which services find and communicate with each other in a distributed architecture. In a microservices environment, services are often dynamically created, scaled, or removed, making it essential for them to locate one another without hardcoding their locations.

There are two main types of service discovery:

  1. Client-Side Discovery: The client is responsible for determining the location of the service it wants to call. It queries a service registry to get the list of available service instances and then chooses one to communicate with.

  2. Server-Side Discovery: The client sends a request to a router or load balancer, which then queries the service registry and forwards the request to an available service instance. The client does not need to know about the service instances' locations.

What is API Gateway in the context of Microservices?

An API Gateway acts as a single entry point for clients to access various microservices. Its importance includes:

  • Routing Requests: Directs client requests to appropriate microservices.
  • Load Balancing: Distributes incoming traffic to ensure optimal resource utilization.
  • Security: Centralizes authentication and authorization, enhancing security.
  • Rate Limiting: Protects backend services from being overwhelmed by requests.
  • Response Aggregation: Combines responses from multiple services into a single response to reduce client-side complexity.

How does Microservices architecture contribute to DevOps practices?

Microservices promote continuous delivery and deployment as each service can be developed, tested, and deployed independently. This aligns with the principles of DevOps, encouraging collaboration and automation.

What is the purpose of a Container in Microservices?

Containers provide a lightweight and consistent environment for running microservices. They encapsulate the application, its dependencies, and runtime, ensuring consistency across different environments.

What is the use of Docker?

Docker offers a container environment which can be used to host any application. This software application and the dependencies that support it which are tightly-packaged together.

Why are Container used in Microservices?

Containers are easiest and effective method to manage the microservice based application. It also helps you to develop and deploy individually. Docker also allows you to encapsulate your microservice in a container image along with its dependencies. Microservice can use these elements without additional efforts.

Explain Circuit Breaker pattern in Microservices.

The Circuit Breaker pattern is a design pattern used to detect and prevent failures in microservices by temporarily stopping requests to a failing service and redirecting those requests to a fallback mechanism.

How can you ensure data consistency in a Microservices architecture?

Ensuring data consistency in a microservices architecture can be challenging. One approach is to use the Saga pattern, where a sequence of local transactions is coordinated to achieve global consistency.

How independent micro-services communicate with each other?

It depends upon your project needs. However, in most cases, developers use HTTP/REST with JSON or Binary protocol. However, they can use any communication protocol.

Can you describe a situation where you successfully implemented a microservices architecture?

In a previous project, I led the migration of a monolithic e-commerce platform to a microservices architecture. We broke down functionalities into independent services such as user management, order processing, and inventory. We used Docker for containerization and Kubernetes for orchestration. By implementing an API Gateway and centralized logging, we improved performance and reduced deployment times from weeks to days. The result was enhanced scalability, allowing us to handle peak traffic during sales events without downtime.

What is the difference between microservices and serverless architecture?

A microservices architecture involves developing an application as a collection of small, autonomous services, each running in its own process and communicating over network calls.

In serverless architecture, developers write functions that a platform runs only when needed, without managing the underlying infrastructure. Serverless architecture is an event-driven execution model and is ideal for simple or single-purpose functions.

Continue Reading →

What is Microservice ?

Microservices are an architectural style that involves breaking down a large application into a collection of loosely coupled services that communicate over well-defined APIs. Each microservice is designed to perform a specific business function and can be developed, deployed, and scaled independently.

Here are some key characteristics and principles of microservices:

  1. Loose Coupling: Services are loosely coupled, meaning changes to one service don't require changes to others.
  2. Independent Deployment: Each microservice can be deployed independently, allowing for faster release cycles and reduced risk.
  3. Resilience: Failure in one microservice should not bring down the entire application. Services are expected to be resilient and handle failures gracefully.
  4. Scalability: Services can be scaled independently based on demand, optimizing resource usage.
  5. Technology Diversity: Each microservice can be implemented using different technologies, frameworks, and programming languages, as long as they communicate through standardized interfaces (typically APIs).
  6. Organizational Alignment: Microservices often align with DevOps principles, allowing development teams to take end-to-end ownership of services they develop and operate.
  7. Domain-Driven Design: Microservices are often organized around business capabilities or domains, which can improve development agility and maintainability.
  8. Data Management: Microservices may have their own databases, and data consistency between services is typically maintained through asynchronous communication and eventual consistency.
  9. Containerization: Microservices are often deployed in containers (e.g., Docker containers) to ensure consistency across different environments and simplify deployment.

What is API Gateway in Microservice?

In a microservices architecture, an API Gateway is a crucial component that acts as a single entry point for clients to interact with various microservices. It provides several important functions to facilitate communication between clients and the microservices behind it:

  1. Routing and Aggregation: The API Gateway routes incoming client requests to the appropriate microservices based on the request path, HTTP method, or other criteria. It can also aggregate multiple requests into a single one to reduce chattiness between clients and services.
  2. Protocol Translation: It can translate between different protocols (e.g., REST, WebSocket) used by clients and the internal protocols used by microservices.
  3. Request and Response Transformation: The API Gateway can modify requests and responses to adapt them to different schemas or versions, ensuring compatibility between clients and services.
  4. Authentication and Authorization: It handles authentication and authorization for incoming requests, ensuring that only authorized clients can access certain microservices or endpoints.
  5. Load Balancing: It can distribute incoming requests across multiple instances of a microservice to ensure optimal performance and scalability.
  6. Rate Limiting and Throttling: The API Gateway can enforce rate limits and throttling to protect microservices from being overwhelmed by too many requests.
  7. Logging and Monitoring: It can log requests and responses for auditing purposes and provide monitoring and analytics capabilities to track usage patterns and performance metrics.

By encapsulating these functionalities, the API Gateway simplifies the client-side experience and offloads common cross-cutting concerns from individual microservices. It promotes scalability, security, and flexibility in managing the interactions between clients and the microservices architecture.

Continue Reading →

Tuesday, 31 October 2023

C# String data type : Exercises

 C# String data type : Exercises, Practice, Solution

Write a C# Sharp program to find the length of a string without using a library function.

  using System;  
  public class Exercise2
  {  
      public static void Main()
  {
      string str; /* Declares a string of size 100 */
      int l= 0;
   
        Console.Write("Input the string : ");
        str = Console.ReadLine();
 
           foreach(char chr in str)
          {
              l += 1;
          }
     Console.Write("Length of the string is : {0}\n\n", l);
    }
  }

Write a program in C# Sharp to count the total number of words in a string.

  using System;  
  public class Exercise5
  {  
      public static void Main()
      {
          string str;
          int i, wrd,l;
   
            Console.Write("Input the string : ");
            str = Console.ReadLine();
   
             l = 0;
             wrd = 1;
 
      /* loop till end of string */
      while (l <= str.Length - 1)
      {
          /* check whether the current character is white space or new line or tab character*/
          if(str[l]==' ' || str[l]=='\n' || str[l]=='\t')
          {
              wrd++;
          }
 
          l++;
      }
 
     Console.Write("Total number of words in the string is : {0}\n", wrd);
    }
  }

Write a program in C# Sharp to compare two strings without using a string library functions.

  using System;  
  public class Exercise6
  {  
      public static void Main()
  {
      string str1, str2;
      int flg=0;
      int i = 0, l1, l2, yn = 0;
     
        Console.Write("Input the 1st string : ");
        str1 = Console.ReadLine();    
       
        Console.Write("Input the 2nd string : ");
        str2 = Console.ReadLine();    
 
      l1=str1.Length;
      l2=str2.Length;
      /*compare checking when they are equal in length*/    
      if(l1==l2)
    {
      for(i=0;i<l1;i++)
        {
            if(str1[i] != str2[i])
            {
              yn= 1;
              i= l1;       
            }
        }
    }
  /*initialize the flag where they are equal, smaller and greater in length*/  
      if(l1 == l2)
          flg=0;
      else if(l1 > l2)
          flg=1;
      else if(l1 < l2)
          flg=-1;
  /*display the message where the strings are same or smaller or greater*/  
      if(flg == 0)
      {
         if(yn==0)
         Console.Write("\nThe length of both strings are equal and \nalso, both strings are same.\n\n");
         else
              Console.Write("\nThe length of both strings are equal \nbut they are not same.\n\n");
      }
      else if(flg == -1)
      {
         Console.Write("\nThe length of the first string is smaller than second.\n\n");
      }
      else
      {
         Console.Write("\nThe length of the first string is greater than second.\n\n");
      }
    }
  }

Write a program in C# Sharp to count the number of alphabets, digits and special characters in a string.

using System;  
  public class Exercise7  
  {  
   public static void Main()
  {
      string str;
      int alp, digit, splch, i,l;
      alp = digit = splch = i = 0;
 
        Console.Write("Input the string : ");
        str = Console.ReadLine();
        l=str.Length;
 
       /* Checks each character of string*/
 
      while(i<l)
      {
          if((str[i]>='a' && str[i]<='z') || (str[i]>='A' && str[i]<='Z'))
          {
              alp++;
          }
          else if(str[i]>='0' && str[i]<='9')
          {
              digit++;
          }
          else
          {
              splch++;
          }
 
          i++;
      }
 
     Console.Write("Number of Alphabets in the string is : {0}\n", alp);
     Console.Write("Number of Digits in the string is : {0}\n", digit);
     Console.Write("Number of Special characters in the string is : {0}\n\n", splch);
    }
  }

Write a program in C# Sharp to copy one string to another string.

using System;  
public class Exercise8  
{  
    public static void Main()
{
    string str1;
    int  i,l;

      Console.Write("\n\nCopy one string into another string :\n");
      Console.Write("-----------------------------------------\n");  
      Console.Write("Input the string : ");
      str1 = Console.ReadLine();
     
      l=str1.Length;
      string[] str2=new string[l];

    /* Copies string1 to string2 character by character */
    i=0;
    while(i<l)
    {
        string tmp=str1[i].ToString();
        str2[i] = tmp;
        i++;
    }
   Console.Write("\nThe First string is : {0}\n", str1);
   Console.Write("The Second string is : {0}\n", string.Join("",str2));
   Console.Write("Number of characters copied : {0}\n\n", i);
  }
}

Write a C# Sharp program to count the number of vowels or consonants in a string.

  public class Exercise9  
  {  
  public static void Main()
  {
      string str;
      int i, len, vowel, cons;
     
      Console.Write("Input the string : ");
      str = Console.ReadLine();  
 
      vowel = 0;
      cons = 0;
      len = str.Length;
 
      for(i=0; i<len; i++)
      {
 
          if(str[i] =='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u' || str[i]=='A' || str[i]=='E' || str[i]=='I' || str[i]=='O' || str[i]=='U')
          {
              vowel++;
          }
          else if((str[i]>='a' && str[i]<='z') || (str[i]>='A' && str[i]<='Z'))
          {
              cons++;
          }
      }
     Console.Write("\nThe total number of vowel in the string is : {0}\n", vowel);
     Console.Write("The total number of consonant in the string is : {0}\n\n", cons);
    }
  }

Write a C# Sharp program to find the maximum number of characters in a string.  Click here

Find the character and Number of Occurrence in given word where number of Occurrence is more then 1

            string val = "Interview";

            Dictionary<string, int> dict = new Dictionary<string, int>();
            for (int i = 0; i < val.Length; i++)
            {
                string c = val[i].ToString().ToLower();
                if (dict.ContainsKey(c))
                {
                    dict[c] = dict[c] + 1;
                }
                else
                {
                    dict[c] = 1;
                }
            }

            foreach (var d in dict.Where(x=> x.Value > 1))
            {
                Console.WriteLine("Key: "+d.Key+" Value: "+d.Value);
            }

Output:

Key: i Value: 2

Key: e Value: 2


Continue Reading →

Monday, 30 October 2023

Arrays in C#

In C#, an array is a collection of elements of the same type that are stored in contiguous memory locations and can be accessed using an index. Arrays provide an efficient way of storing and accessing a fixed number of elements.

 Create an array 

There are multiple ways to create an array in C#. Here are a few examples.

Using the new keyword

  int[] numbers = new int[5];

The above code snippet creates an array called "intArray" to hold five integers. However, the elements of the Array are not yet initialized, and their values are undefined.

Using the new keyword with an array initializer

Arrays can also be initialized when they are declared by providing a list of comma-separated values enclosed in curly braces {}

  int[] intArray = new int[] {1, 2, 3, 4, 5};

  // or Simply
 
  int[] intArray = {1, 2, 3, 4, 5};

This creates an array called "intArray" with five elements and assigns the values 1, 2, 3, 4, and 5 to the elements of the Array.

Using the var keyword

  var myArray = new int[] {1, 2, 3, 4, 5};

This creates an array; the array type is inferred from the initializer, and the Array's name is myArray.

How To Sort Array In C#

The simplest way to sort an array in C# is using Array.Sort method. The Array.Sort method takes a one-dimensional array as an input and sorts the array elements in the ascending order.

The following code snippet creates an array of integers.

  int[] intArray = new int[] { 9, 2, 4, 3, 1, 5 };

The Array.Sort method takes array as an input and sorts the array in ascending order.

  Array.Sort(intArray);

To sort an array in descending order, we can use Sort.Reverse method. This method also takes an array as an input and sorts its elements in descending order. The following code snippet reverses an array.

  Array.Reverse(intArray);

Sort an Array of Int in C#

Here is the complete code that creates an array of integers and sorts in ascending and descending orders using Array.Sort and Array.Reverse methods.

static void Main(string[] args) {
    // Array of integers
    int[] intArray = new int[] {
        9,
        2,
        4,
        3,
        1,
        5
    };
    Console.WriteLine("Original array");
    foreach(int i in intArray) {
        Console.Write(i + " ");
    }
    Console.WriteLine();
    // Sort array in ASC order
    Console.WriteLine("Sorted array in ASC order");
    Array.Sort(intArray);
    foreach(int i in intArray) {
        Console.Write(i + " ");
    }
    Console.WriteLine();
    Console.WriteLine("Sorted array in DESC order");
    // Sort Array in DESC order
    Array.Reverse(intArray);
    foreach(int i in intArray) {
        Console.Write(i + " ");
    }
    Console.WriteLine();

The output of the above code is below where first it prints the original array, followed by the sorted array in ASC and DESC order respectively.


Sort an Array of Strings in C#

Now let’s sort an array of strings in C#. Sorting an array of strings is like sorting an array of int. The Array.Sort method takes an input value of an array of strings. The following code example shows how to sort an array of strings in ascending and descending orders using C#.

  // Array of strings
string[] strArray = new string[] { "Mahesh", "David", "Allen", "Joe", "Monica" };
Console.WriteLine();
Console.WriteLine("Original array");
foreach (string str in strArray)
{
    Console.Write(str + " ");
}
Console.WriteLine();
// Sort array
Array.Sort(strArray);
// Read array items using foreach loop
foreach (string str in strArray)
{
    Console.Write(str + " ");
}
Console.WriteLine();
Array.Reverse(strArray);
foreach (string str in strArray)
{
    Console.Write(str + " ");
}
Console.WriteLine();

The output of the above code displays original array, sorted array in the ascending order, and sorted array in the descending order.


Sort a Range of Elements In An Array

The Sort.Array method allows you to sort a range of elements within an array. For example, if an array has 11 elements but what if you want to sort only 1st to next 6 elements in the array? You can use that by passing the first starting index of the element followed by the number of elements to be sorted.

// Array of integers
int[] intArray = new int[] { 9, 2, 4, 3, 1, 5, 6, 9, 5, 7, 1, 0};
// Sort array from 1st element to 6th element. Skip 0th element.
Array.Sort(intArray, 1, 6);
foreach (int i in intArray)
{
    Console.Write(i + " ");
}

The output looks like the following where you can see only 6 elements are sorted after skipping the first element of the array.

9 1 2 3 4 5 6 9 5 7 1 0

Note that this sorting applies to all types of arrays not just integers.


Continue Reading →

Sunday, 8 October 2023

HTML5 Features

 Top HTML5 Features are:

HTML stands for Hyper Text markup language, and HTML 5 is the 5th version of it. A lot of dynamic parameters were missing in the HTML for which we have to depend on third-party libraries, however, in the latest version of HTML it has become a lot easier for building a dynamic website.

Browser support for HTML5

All modern browsers, including Google Chrome, Mozilla Firefox, Opera Mini, Microsoft Edge, and Apple Safari, support HTML 5 in all of their features. Because HTML 5 capabilities are not adequately supported by earlier browser versions, developers must create alternative content to ensure cross-browser compatibility. 

below are the list of Top HTML5 Features, which are described in detail below:

  1. Semantic Elements
  2. Audio and Video Support
  3. Canvas Elements
  4. Geolocation API
  5. Local Storage
  6. Responsive Images
  7. Web Workers
  8. Drag and Drop API
  9. Form Enhancements
  10. Web Sockets
  11. Micro Data
  12. Cross Document Messaging
For details, visit website

Continue Reading →

Saturday, 30 September 2023

Web API Versioning

What Is API Versioning?

API versioning is the process of iterating different versions of your API.

Why Is API Versioning Required?

While working on an existing application or creating a new one, we may create multiple APIs that may be consumed by many clients. When the business has started to grow and expand, new requirements arise. Due to this, we may need to provide more functionality in the existing APIs. However, existing Web API can be consumed by many clients so how to implement the new feature without impacting the existing consumers? We can solve this problem by versioning our API.

There are some common ways to version a REST API.

1. Versioning through URI

The most commonly used versioning is in which we can add a version to the API base URL.

Example:

http://api-demo.example.com/api/1/employee

This approach is easy to implement and understand, as clients can simply request the desired version of the API by specifying the corresponding URL. Here are the steps to implement URL-based versioning in ASP.NET Core:

Install the Microsoft.AspNetCore.Mvc.Versioning NuGet package in your ASP.NET Core project. You can do this using the Package Manager Console or the NuGet Package Manager in Visual Studio.

In the ConfigureServices method of your Startup.cs file, configure the API versioning options by adding the following code:

  services.AddApiVersioning(options =>
    {
        options.DefaultApiVersion = new ApiVersion(1, 0);
        options.AssumeDefaultVersionWhenUnspecified = true;
        options.ReportApiVersions = true;
        options.ApiVersionReader = new UrlSegmentApiVersionReader();
    });

This code configures the default API version to be 1.0, assumes the default version when not specified in the URL, reports the API versions in the response headers, and uses the URL segment as the versioning source.

In your controller, add the ApiVersion attribute to specify the supported API versions for each action method. For example:

  [ApiController]
  [Route("api/v{version:apiVersion}/[controller]")]
  [ApiVersion("1.0")]
  public class MyController : ControllerBase
  {
      [HttpGet]
      public IActionResult Get()
      {
          return Ok("Version 1.0");
      }
     
      [HttpGet, MapToApiVersion("2.0")]
      public IActionResult GetV2()
      {
          return Ok("Version 2.0");
      }
  }

This code specifies that the controller supports version 1.0 of the API, and that the GetV2 action method supports version 2.0. The [MapToApiVersion] attribute maps the action method to version 2.0.

Test the API by sending requests to the corresponding URLs. For example:

http://localhost:5000/api/v1.0/my -> returns "Version 1.0"

http://localhost:5000/api/v2.0/my -> returns "Version 2.0"

By using URL-based versioning in ASP.NET Core, you can easily manage different versions of your API and provide backward compatibility to existing clients.

2. Query String

Another option for versioning a REST API is to include the version number as a query parameter.

This is a straightforward way to version an API from an implementation point of view.

Example:

https://api-demo.example.com/api/employee/?api-version=2

Follow the same steps and code as mentioned above. change code for AddApiVersioning method. in this only  ApiVersionReader  property is changed.

  services.AddApiVersioning(options =>
    {
        options.DefaultApiVersion = new ApiVersion(1, 0);
        options.AssumeDefaultVersionWhenUnspecified = true;
        options.ReportApiVersions = true;
        options.ApiVersionReader = new QueryStringApiVersionReader("version");
    });

Test the API by sending requests with the "version" query parameter. For example:

http://localhost:5000/api/my?version=1.0 -> returns "Version 1.0"

http://localhost:5000/api/my?version=2.0 -> returns "Version 2.0"

By using query string-based versioning in ASP.NET Core, you can provide a flexible and convenient way for clients to specify the desired version of your API.

3. Custom headers

Define a new header that contains the version number in the request as part of the request header itself.

Example:

GET https://api-demo.example.com/api/employee
Accept-Version: 3

Follow the same steps and code as mentioned above. change code for AddApiVersioning method. in this only  ApiVersionReader  property is changed.

  services.AddApiVersioning(options =>
    {
        options.DefaultApiVersion = new ApiVersion(1, 0);
        options.AssumeDefaultVersionWhenUnspecified = true;
        options.ReportApiVersions = true;
        options.ApiVersionReader = new HeaderApiVersionReader("X-Version");
    });

This code configures the default API version to be 1.0, assumes the default version when not specified in the header, reports the API versions in the response headers, and uses the "X-Version" header as the versioning source.

Test the API by sending requests with the "X-Version" header. For example:

http://localhost:5000/api/my

X-Version: 1.0 -> returns "Version 1.0"

X-Version: 2.0 -> returns "Version 2.0"

By using header-based versioning in ASP.NET Core, you can provide a flexible and non-intrusive way for clients to specify the desired version of your API.

Learn More: https://codelikeadev.com/https://www.c-sharpcorner.com/
                        https://www.dotnettricks.com/https://blog.devart.com/


Continue Reading →

Wednesday, 2 August 2023

Dotnet Core Versions

Dotnet Core Versions:

Supported versions

Version

Release type

Support phase

Latest release

Latest release date

End of support

.NET 8.0

Long Term Support

Preview

8.0.0-preview.6

July 11, 2023

 

.NET 7.0 (latest)

Standard Term Support 

Active 

7.0.9

July 11, 2023

May 14, 2024

.NET 6.0

Long Term Support 

Active

6.0.20

July 11, 2023

November 12, 2024

Out of support versions

The following releases have reached end of life, meaning they're no longer supported. We recommend moving to a supported release.

Version

Latest release

Latest release date

End of support

.NET 5.0

5.0.17

May 10, 2022

May 10, 2022

.NET Core 3.1

3.1.32

December 13, 2022

December 13, 2022

.NET Core 3.0

3.0.3

February 18, 2020

March 3, 2020

.NET Core 2.2

2.2.8

November 19, 2019

December 23, 2019

.NET Core 2.1

2.1.30

August 19, 2021

August 21, 2021

.NET Core 2.0

2.0.9

July 10, 2018

October 1, 2018

Continue Reading →

Topics

ADFS (1) ADO .Net (1) Ajax (1) Angular (47) Angular Js (15) ASP .Net (14) Authentication (4) Azure (3) Breeze.js (1) C# (49) CD (1) CI (2) CloudComputing (2) Coding (8) CQRS (1) CSS (2) Design_Pattern (7) DevOps (4) DI (3) Dotnet (10) DotnetCore (19) Entity Framework (4) ExpressJS (4) Html (4) IIS (1) Javascript (17) Jquery (8) Lamda (3) Linq (10) microservice (4) Mongodb (1) MVC (46) NodeJS (8) React (10) SDLC (1) Sql Server (32) SSIS (3) SSO (1) TypeScript (3) UI (1) UnitTest (2) WCF (14) Web Api (16) Web Service (1) XMl (1)

Dotnet Guru Archives