Skip to main content

Posts

Showing posts with the label Dotnet Core

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

The main objective of the article are: .Net 6 Web API And React (V18) Application Communication Install SQL Server And SQL Management Studio Create A SQL Database Create A SQL Database Table .Net6 Web API And React(V18) Application Communication: User requests the React JS application(single page application) then js files are downloaded and then runs the app on the browser. Since React JS 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 The SQL Server And SQL Management Studio: First, install the SQL server on our local machine. So go to "https://www.microsoft.com/en-in/sql-server/sql-server-downloads" and then install the developer version which is accessible 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?view=sql-

Part-1 A Demo On JWT Access Token And Refresh Token Authentication In .NET6 Web API

In this article, we are going to generate JWT Access Token to authenticate users against .NET6 Web API application. JWT Token(Or Access Token): JWT Token(JSON Web Token) is a digitally signed and secured token for user validation. JWT Token building components are like: Header Payload Signature JWT Access Token Flow: User request API with user credentials API validates the user credentials and generates the JWT token returns it as a response to the client application. The client application on receiving the JWT token makes the user authenticated and sends the JWT token as a header to every subsequent API request. API reads the JWT token from the request header, then API validates the token if it is a valid token then API allows the request to consume its authorized resources. Create A .NET6 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.Net

A Demo To Consume Azure Cosmos DB By .Net6 Web API

In this article, we will implement a .NET6 Web API that consumes the Azure Cosmos DB. Azure CosmosDB: Azure Cosmos DB is a fully managed NoSQL database. NoSQL says data will be stored as a key/value JSON document. Cosmos DB provides 'High Availability' and 'Low Latency' for any application. Cosmos DB is very quick in response delivering, auto-scaling, effective auto failure management, etc. Any existing application that works on different DBs can be easily migrated to Azure CosmosDB as it provides APIs for integration like 'SQL/Core API'(most recommended API, our demo uses this 'SQL/Core API'), 'MongoDB API', 'Cassandra API', 'Germlin API', 'Table API'. Let's understand the structure of the Cosmos DB: Create an Azure Cosmos Account with an appropriate subscription inside of the Azure portal. After creating the Cosmos Account, we can manage the data of our account by creating 'Database', 'Containers', an

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

The main objectives of this article are: Implement HTTP Post Create Action Method In API Implement HTTP Post API Call At Student Service In Angular App Student Component Implement Logic To Create A New Student Implement HTTP Put Update Action Method In API Implement HTTP Put API Call-In Student Service Student Component Implement Logic To Update An Existing Student Implement HTTP Delete Action Method In API Implement HTTP Delete API Call At Student Service Student Component Implement Logic To Delete Student Implement HTTP Post Create Action Method In API: Let's try to create a new student record into our database by implementing the HTTP Post Action Method(or Create action method.) in our 'StudentController'. API_Project/Controllers/StudentController.cs: [HttpPost] public async Task<IActionResult> Post(Student.Api.Data.Entities.Student payload) { _myWorldDbContext.Student.Add(payload); await _myWorldDbContext.SaveChangesAsync(); return Ok(payload); } (Line: 1