Skip to main content

Posts

Showing posts with the label dotnet7

Part-2 | Blazor WebAssembly | .Net7 API | MudBlazor | CRUD - Create API Project

The main objectives of this article are: Create .NET7 API Project Install Entity Framework Core Package Setup Database Context Create A .NET7 Web API Project: Let's create a sample .Net 7 API application to accomplish our demo. (Step 1) (Step 2) (Step 3) (Step 4) Install Entity Framework Core NuGet Package: Let's install the entity framework core package. Let's install the entity framework core SQL NuGet package. SQL Connection String: Let's prepare the SQL connection string. Sample SQL Connection String: Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MyWorldDB;Integrated Security=True;Connect Timeout=30 Data Source - SQL server name. Initial Catalog - Database name Integrated Security -windows authentication. Connect Time -connection time period. Let's configure the connection string in 'appsettings.Development.json'. appsettings.Development.json: "ConnectionStrings": { "MyWorldDbConnection": "Data Source=(localdb)\\M

A Demo On Clean Architecture | MediatR CQRS Pattern | .NET7 Web API

In this article, we will learn about 'Clean Architecture', 'CQRS Pattern With MediatR' by implementing in .NET7 Web API. Clean Architecture: The Clean Architecture comprises of: Domain Layer Application Layer Infrastructure Layer UI Layer Clean Architecture lives on the dependency inversion principle. In general business logic depends on the data access layer or infrastructure layer. But in clean architecture, it is inverted, which means the data access layer or infrastructure layers depends on the business logic layer(which means the Application Layer) . Domain Layer: the domain layer project will have 'Entities'(Domain Models), 'Domain Services', and 'Value Object'. This project is a parent project and it is independent on all other projects. Application Layer: the application layer project contains business logic files, DTOs, mapper, etc. This project can depend only on the 'Domain Layer Project'. Infrastructure Layer: the infrastruct

Part - 8 | Asp.Net Core Identity Series[.NET 7] | Microsoft Account Authentication

The main objectives of this article are: Implementing Microsoft Account Authentication. Install Microsoft Account Authentication NuGet Package: Let's install the required package for Microsoft Account Authentication Visual Studio 2022: Install-Package Microsoft.AspNetCore.Authentication.MicrosoftAccount -Version 7.0.4 Visual Studio Code: dotnet add package Microsoft.AspNetCore.Authentication.MicrosoftAccount --version 7.0.4 Register Our App With Microsoft Azure Portal: To enable Microsoft authentication to our application, we have to register our app into the Microsoft Azure Portal. So following are steps to resisting the app with the Microsoft portal. (Step 1) Go to the Azure Portal 'https://portal.azure.com/'. Then select 'App Registration.' (Step 2) On the 'App Registration' page, select the 'New registration' button. (Step 3) Provide a 'Display Name' and then choose 'Supported account types'. (Step 4) Select 'Web'

A Small Demo On OData(v8) In .NET 7 API Application

In this article, we are going to implement a sample on OData in .NET7 API application. OData: The OData(Open Data Protocol) is an application-level protocol for interacting with data via the restful interface. OData supports the description of data models, editing, and querying of data according to those models. OData query features are: $select $orderBy $filter $skip $count $expand Sample SQL Table Scripts: Let's run the below sample SQL script to create a table like 'Employee'. Sample SQL Script: Create Table Employee( Id INT IDENTITY(1,1) NOT NULL, FirstName VARCHAR(200) NULL, LastName VARCHAR(200) NULL, Salary Decimal(18,2) NULL, JobRole VARCHAR(50) NULL CONSTRAINT PK_Employee PRIMARY KEY (Id) ) Create .NET7 Web API Application: Let's create the .NET 7 Web API application to accomplish our demo. Here to create .NET 7 application we use IDE's(editors) either Visual Studio 2022 or Visual Studio Code(Using .NET CLI command). In this demo, we are going to use