Skip to main content

Posts

Showing posts with the label API

Part-3 | .NET 6 Web API | SQL Database | React JS(v18) | CRUD Example

The main objectives of this article are: .Net6 Web API Install .NET6 SDK Create .Net6 Web API Application Entity Framework Core  Install Entity Framework Core NuGet SQL Connectionstring Setup Entity Framework Core Database Context .NET6 Web API: Web API is a framework for building an HTTP service that can be accessed by any client like a browser  mobile devices, and 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 are: 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 ide

Part-2 | .NET 6 Web API | SQL Database | React JS(v18) | CRUD Example

The main objectives of this article are: Creating React JS(v18) Application. Install React JS Bootstrap Add Bootstrap Menu Create React JS Application: To create a React JS application our local machine should contain NodeJS. So go to "https://nodejs.org/en/download/". Command to create the ReactJS application. npx create-react-app my-app Command to run and start the ReactJS server. npm start Let's go through the project and explore important files. index.html:  Inside the public folder we can see the index.html. Only the HTML file of the entire ReactJS application. It contained a 'div' element whose 'id' value is 'root', inside of this element all ReactJS components get rendered. index.js: Entry javascript file for ReactJS. It helps paint 'App' component content in 'index.html'. App.js: The 'App.js' react component. It returns the 'JSX'(Javascript XML) content(JSX means writing HTML code inside of javascript dir

Part-1 A CRUD Operation Demo With .NET6 Web API | SQL Database | Angular13

The main objectives of the article are: .NET API And Angular Application Communication. Install SQL Server And SQL Management Studio. Create SQL Database Table .NET API And Angular Application Communication: User request the angular application(Single Page Application) then js files are downloaded and then runs the browser. Since Angular is a single-page application, it depends on API for data to display. API runs at the server that gives JSON response. API communicates with the database for fetching the data. Install SQL Server And SQL Management Studio: First, install SQL serve in our local machine. So go to line 'https://www.microsoft.com/en-in/sql-server/sql-server-downloads' and then install the developer version which is free and fully functional. Next, install the SSMS(SQL Server Management Studio) IDE at 'https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms' Create A Database: A Database contains a collection of tabes

Part-4 Asynchronous Data Communication Between Microservices Using RabbitMQ Message Broker With MassTransit[.NET6 Microservice Series]

In this article, we are going to establish asynchronous data communication between microservice using the RabbitMQ message broker along with MassTransit. Now let's take look at the 'Orders' GET endpoint response. Here we can understand we don't have 'Product' information. So we have to make a way to save the required 'Product' information into the 'SalesBusiness.API' microservice application from the 'Manufacture.API' microservice application. Steps we are going to accomplish this demo are: Configure RabbitMQ message broker with MassTransit for asynchronous data communication between the microservices. In the 'Manufacture' database we have a 'Products' table(like Master table), now we will create a new 'Products' table(like child table) in 'SalesDatabase', but here we will add only required columns. So that while fetching the 'Orders' endpoint it is to fetch required products information. So with he

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 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