Skip to main content

Posts

Showing posts with the label Web API

A Demo On .NET6 API Sending Email Using SendGrid NuGet Package

In this article, we are going to implement a sample in .NET6 Web API to send emails using the SendGrid Nuget Package. Create A .Net6 Web API Project: Let's create a .Net6 Web API sample application to accomplish our demo. We can use either Visual Studio 2022 or Visual Studio Code(using .NET CLI commands) to create any.Net6 application. For this demo, I'm using the 'Visual Studio Code'(using the .NET CLI command) editor. CLI command dotnet new webapi -o Your_Project_Name SendGrid: SendGrid is a third-party email provider from which we can deal with 'send', and 'receive' operations of email to our application. SendGrid SMTP(Simple Mail Transfer Protocol) provider for email transfer. SendGrid also provides SendGrid .Net NuGet package that provides easy configuration to any .NET applications. So to use the SendGrid SMTP we need 'Auth Key', 'From Email', so let's register into the SendGrid. The following are the steps to register and

Part-3 Create A Microservice For The Orders Endpoint[.NET6 Microservice Series]

In this article, we will create our second microservice application that contains the orders endpoint. The microservice application consists of simple or single module logic endpoints. So here I'm going to create 2 endpoints like HTTP GET, HTTP POST for the 'Orders' to accomplish our demo. Part-2 Create A Microservice For The Products Endpoint[.NET6 Microservice Series] Create A .NET6 Web API Application: Let's create our second microservice application with .NET6 Web API application. Let's name our microservice project 'SalesBusiness.Api'. To create .NET6 application recommended IDE's are 'Visual Studio 2022', 'Visual Studio Code'. In this demo, I'm using .NET CLI and Visual Studio Code editor. CLI command dotnet new webapi -o Your_Project_Name Install NuGet Packages: Install EntityFramework Core NuGet. .NET CLI command dotnet add package Microsoft.EntityFrameworkCore --version 6.0.3 Package Manager command Install-Packa

Part-2 Create A Microservice For The Products Endpoint[.NET6 Microservice Series]

In this article, we will create a microservice application that contains the product endpoint. So creating a microservice means the application contains endpoints related to a specific module or component. So here I'm going to create 2 endpoints like HTTP GET, HTTP Post for the products to accomplish our demo. (We can implement the entire CRUD operation endpoint if we want). Click here for Part-1 of the .NET6 Microservice Series . Create A .NET6 Web API Application: Let's create our first microservice application with .NET6 Web API application. Let's name our microservice project as 'Manufacture.Api'. To create .NET6 application recommended IDE's are Visual Studio 2022', 'Visual Studio Code'. In this demo, I'm using .NET CLI and Visual Studio Code editor. CLI command dotnet new webapi -o Your_Project_Name Install NuGet Packages: Install EntityFramework Core NuGet. .NET CLI command dotnet add package Microsoft.EntityFrameworkCore --ve

.NET6 Web API CRUD Operation With MongoDB

In this article, we are going to implement .NET6 Web API CRUD operation using MongoDB as database. MongoDB: MongoDB is a source-available cross-platform document-oriented database. It is also called a NoSQL database or Non-Relational database. In MongoDB 'Collection' is equivalent to the Table in SQL database. In MongoDB data is stored as 'Document' that is equivalent to a table record in an SQL database. The 'Document' contains JSON data which will be stored in BSON(Binary JSON) format. Create A .NET6 Web API Application: Let's create a .Net6 Web API sample application to accomplish our demo. We can use either Visual Studio 2022 or Visual Studio Code(using .NET CLI commands) to create any.Net6 application. For this demo, I'm using the 'Visual Studio Code'(using the .NET CLI command) editor. CLI command dotnet new webapi -o Your_Project_Name MongoDB Docker Image: In this demo, I will consume the MongoDB that's run as a Docker container.

.NET6 Web API CRUD Operation With Entity Framework Core

In this article, we are going to do a small demo on AspNetCore 6 Web API CRUD operations. What Is Web API: Web API is a framework for building HTTP services that can be accessed from any client like browser, mobile devices, desktop apps. In simple terminology API(Application Programming Interface) means an interface module that contains a programming function that can be requested via HTTP calls to save or fetch the data for their respective clients. Some of the key characteristics of API: Supports HTTP verbs like 'GET', 'POST', 'PUT', 'DELETE', etc. Supports default responses like 'XML' and 'JSON'. Also can define custom responses. Supports self-hosting or individual hosting, so that all different kinds of apps can consume it. Authentication and Authorization are easy to implement. The ideal platform to build REST full services. Create A .NET6 Web API Application: Let's create a .Net6 Web API sample application to accomplish our