This Angular tutorial helps you get started with Angular quickly and effectively through many practical examples.

.NET Core - Introduction


Introduction

In this tutorial, we are going to discuss about Web API , why Web Api required etc. This article can be used to understand API concept by any beginner, intermediate and professional. Here we willl cover the following:

  1. What is Web API
  2. Types of Web API
  3. .NET Core API Introduction
  4. ASP.NET Core Web API Testing Tools
  5. Why ASP.NET Core Web API required
  6. Advantages of ASP.NET Core  Web API
  7. Disadvantage of ASP.NET Core  Web API

1. What is Web API?

API is the acronym for Application Programming Interface. Web Api is an intermediate Programming Interface that allows two or more applications to intract or communicate with each other. It uses HTTP protocol to communicate between clients (Browser) and websites.  The following are the most widely used examples of web API.

  1. Google Maps API
  2. Twitter API

angular Architecture

2. Types of Web API

Basically when you develop API with its purpose. there are four types of web API as following:

Web API Types

  1. Open API - Public APIs are implied to be open for all, that means there is no restrictions on access and are publicly available for all.
  2. Partner API - Access to this category of APIs is extended through a licensure model.
  3. Internal API - This type of API used for in house or internal purpose. The organization tests the veracity of its services/products usually with such APIs.
  4. Composite APIs - They are a sequence of processes triggered when a series of other tasks are executed.

3. .NET Core Web API Introduction

.NET Core is a free, open-source, cross-platform framework developed by Microsoft for building modern applications. It is a modular and lightweight platform that allows developers to build applications that run on Windows, macOS, and Linux.

Here are some key Characteristics or features of .NET Core.

  1. Cross-platform - .NET Core is designed to be cross-platform, meaning you can develop and run applications on multiple operating systems, including Windows, macOS, and Linux. This allows for greater flexibility and reach for your applications.
  2. Open-source - .NET Core is an open-source framework and is developed in collaboration with the .NET community. This means that developers have access to the source code, can contribute to the framework, and benefit from community-driven enhancements and bug fixes.
  3. Modular and Lightweight - .NET Core follows a modular design, with its functionality split into smaller packages called NuGet packages. This modular approach allows developers to include only the necessary components in their applications, resulting in smaller and more efficient deployments.
  4. High Performance - .NET Core is optimized for performance and is known for its fast startup times and efficient resource utilization. It includes features such as Just-in-Time (JIT) compilation, which dynamically compiles code for execution, and Ahead-of-Time (AOT) compilation, which pre-compiles code for even faster startup.
  5. Multiple Application Types - .NET Core supports a variety of application types, including console applications, web applications (ASP.NET Core), microservices, cloud-based applications, and IoT (Internet of Things) applications. This flexibility allows developers to choose the most suitable application model for their specific needs.
  6. Language Support - .NET Core supports multiple programming languages, including C#, F#, and Visual Basic. This allows developers to choose their preferred language for application development while leveraging the power and capabilities of the .NET platform.
  7. Integration with Visual Studio - .NET Core integrates seamlessly with Microsoft's popular integrated development environment (IDE), Visual Studio. Developers can leverage Visual Studio's rich set of tools and features for code editing, debugging, testing, and deployment of .NET Core applications.
  8. Cloud and Container Support - .NET Core is designed with cloud and container environments in mind. It supports popular cloud platforms such as Microsoft Azure and Amazon Web Services (AWS). It also has built-in support for containerization technologies like Docker, allowing for easy deployment and scalability of applications.
  9. Long-Term Support (LTS) Versions - Starting with .NET Core 3.1, Microsoft introduced Long-Term Support (LTS) versions of .NET Core. These LTS versions receive three years of support and are recommended for applications that require stability and long-term maintenance.
  10. Migration Path from .NET Framework - For developers with existing .NET Framework applications, Microsoft provides tools and guidance for migrating to .NET Core. This allows you to modernize your applications and take advantage of the benefits and features offered by .NET Core.

4. ASP.NET Core Web API Testing Tools?

The following are the testing tools for Web API.

  1. Katalon Studio
  2. Postman
  3. Apigee
  4. JMeter
  5. Rest-assured
  6. Assertible
  7. Soap UI
  8. Karate DSL

5. Why is ASP.NET Core Web API required?

Web API have the feature of cross-platform framework. The user wants to access the application from different devices like mobile, browser, Google devices etc. In this type requirement, Web API can be useful source. Different devices send request to Web API and Web API will give respond in JSON format. Most of the devices are able to understand JSON format Output.

Let's see the below web Api Architecture which shows how different devices can access web API.

Web API

In the above diagram a client (Browers, Phones, Talets and Devices) called API controller. API Controller communcate with business layer and get Data from DB. The output will be returned in JSON format.

6. ASP.NET Core Web APIAdvantages

There are following Advantages of Web API when we use.

  1. It supports non-soap based services like xml or json string.
  2. It supports full features of HTTP (like Get, Put, Post, Delete for CRUD operations).
  3. It widely supported clients like browsers and mobiles.
  4. It can be hosted in IIS or outside of IIS(self hosted).
  5. It Supports all the MVC Feature like routing, controllers
  6. It supports OData
  7. It supports model binding and validations.
  8. Unlike WCF REST services, there is no need to define tedious configuration settings for different devices in Web API.
  9. API helps you to expose service data to the browser.

7. ASP.NET Core Web API Disadvantages

There are following Disadvantages of Web API when we use.

  1. Creating API is a very time-consuming process.
  2. A fixed scale is necessary.
  3. To create API, programming knowledge is necessary.
  4. Maintenance cost is very high.
  5. It can crash when testing API.

Next