Skip to main content

Posts

Showing posts with the label MVC

A Demo On Azure AD B2C Authentication In MVC Application[.NET 6]

In this article, we are going to do a demo on Azure AD B2C authentication in the MVC application[.NET 6]. Azure AD B2C Configuration Steps: Step1: Login into Azure Portal( https://portal.azure.com/ ) Step2: Chose the directory that has the subscription(eg: free, student, pay-as-you-go, etc). (1) Select the 'Directories + Subscriptions' on the azure portal menu. (2) Left side menu select 'Directories + Subscriptions'. Bottom select 'All Directories' tab where we can select all directories we have the option to 'switch'. Here I have only one directory that has my subscription. So if we have multiple directories then we can see a 'switch' option. Step 3: The 'Microsoft.AzureActiveDirectory' resource provider needs to register with our 'subscription'. (1) On the Azure portal home page select 'Subscriptions'. (2) Now select your appropriate subscription. (3) Search 'Resource Provider' and then 'Microsoft.AzureAc

CSS Isolation Of Razor Pages/Views[.NET6 Feature]

In this article, we will know about a .NET6 feature that is CSS isolation of razor pages/views. CSS Isolation: CSS isolation means creating a CSS file like '.cshtml.css' for each razor page/view(.cshtml). CSS isolation helps to avoid dependencies on global styles that will be very hard to maintain and also avoid style conflicts among the nested content. In this isolation process, the style defined in the '.csthm.css' file are scoped and they are applied to respective razor pages/views. For example, any styling that is added in 'index.cshtml.css' file will only apply to 'index.cshtml' page, they won't affect any other page in the application. The .NET framework runtime will bundle all the isolated CSS files(*.csthml.css) in the single file that is '{your_application_name}.styles.css'. So this bundled CSS line will be added automatically at '{Pages/Views}/Shared/_Layout.cshml' by the framework.  The bundle CSS file({your_application}.st

.NET5 MVC CRUD Operations Using Entity Framework Core

In this article, we will learn about .Net5 MVC CRUD operation using Entity Framework Core. MVC: The Model-View-Controller(MVC) is an architectural pattern. MVC divides UI applications into 3 different layers. Each layer will have its own responsibility. An MVC application on encountering the user request will be sent to the controller. The controller will query the required data from the database and then furnished our data into 'Model' and then select appropriate 'View'. The 'View' will render the data or logic inside of the 'Model'. The 'Model' is the bridge between 'Controller' and 'View' for transferring the data. So in  MVC, the 'Controller' depends on both 'Model' and 'View', the 'View' depends on 'Model'. Create A .Net5 MVC Application: Begin our journey by creating a .Net5 MVC application. Visual Studio users can easily create a .Net5 MVC templated application. On Creating applic