- UseDevelopeerExceptionPage
- Captures synchronous and asynchronous System.Exception instances from the pipeline and generates HTML error responses.
- UseHsts
- Adds middleware for using HSTS, which adds the Strict-Transport-Security header.
- UseRouting
- Adds middleware that defines a point in the pipeline where routing decisions are made and must be combined with a call to UseEndpoints where the processing is then executed. This means that for our code, any URL paths that match / or /index or /page will be mapped to Razor Pages and match on /hello will be mapped to the anonymous delegate. Any other URL paths will be passed on to the next delegate for matching, for example, static files. This is why, although it looks like the mapping for Razor Pages and /hello happen after static files in the pipeline, they actually take priority because the call to UseRouting happens before UseStaticFiles.
- UseHttpsRedirection
- Adds middleware for redirecting HTTPS requests to HTTPS, so in our code request for htttp://lcocalhost:5000 would be modified to https://localhost:5001
- UseDefaultFiles
- Adds middleware that enables default file mapping on the current path, so in our code it would identify files such as index.html
- UseStaticFiles
- Adds middleware that looks in wwwroot for static files to return in the HTTP response.
- UseEndpoints
- Adds middleware to execute to generate response from decision made earlier in the pipeline. Two endpoints are added, as shown in the following sub-list.
- MapRazorPages
- Adds middleware that will map URL paths such as /suppliers to Razor Page file in the /Pages folder named suppliers.cshtml and return the result as the HTTP response.
- MapGet
- Adds middleware that will map URL paths such as /hello to an inline delegate writes plain test directly to the HTTP response.
Saturday, November 19, 2022
asp.net middleware extension methods
run, map and use methods in asp.net
Run
Adds a middleware delegate that determinates the pipeline by immediately returning a response instead of calling the next middleware delegate.
Map
Adds a middleware delegate that creates a branch in the pipeline when there is a matching request usually based on a URL path like /hello
Use
Adds a middleware delegate that forms part of the pipeline so it can decide if it wants to pass the request to the next delegate in the pipeline and it can modify the request and response before and after the next delegate.
Registering services in the ConfigureServices method
- AddMvcCore
- AddAuthorization
- AddDataAnnotations
- AddCacheTagHelper
- AddApiExplorer
- AddCors
- AddFormaterMappings
- AddMvcCore
- AddAuthorization
- AddDataAnnotations
- AddCacheTagHelper
- AddApiExplorer
- AddCors
- AddFormattermappings
- AddViews
- AddRazorViewEngine
Friday, November 18, 2022
The Object Oriented Thought Process 5th Edition
Wednesday, November 9, 2022
How to pass data to parent in vue.js
This is how we can pass data from child to parent component in vue js.
- child component should emit a custom event which pass data.
- parent component should listen for it via v-on
Tuesday, November 8, 2022
How to install and initialize vue js?
INSTALLING VUE JS
- Using Scripts
- Development Scripts
- Production Scripts
- CLI
- npm
- npm install --global @vue/cli
- yarn
- yarn global add @vue/cli
How to create database context class and adding tables to it? ASP.NET Core 6
Saturday, November 5, 2022
ASP.NET6 command to scafold modules using an existing database
NOTE : Make sure Microsoft.EntityFrameworkCore.Design package should be added to your project.
dotnet ef dbcontext scaffold "Filename=dbname.db" Microsoft. EntityFrameworkCore.Sqlite --table tablename --table tablename --outputdir Foldername --namespace Namespace --data-annotations --context DbcontextNote the following:
asp.net core connection string for all databases in detail.
SQLITE
To make an SQLite database connection string, we just need to know the databse filename, set using the paramenter Filename.
Steps :
SQL Server
To connect to an SQL Server database, we need to know all these pieces of informations given.
- Server name
- Database name
- Security informations such as username & password or if we pass the currently logged-on user's credentials automatically.
We specify this information in a connection string
Steps :
Wednesday, November 2, 2022
How to use vue with dotnet6 ?
Follow these steps to use Vue with asp.net core.
1. Go To- https://dotnetnew.azurewebsites.net/
2. Search for Vue and select one template
3. Click on- go to project
4. Clone or download the repository
5. Run the command.
methods available in Dapper
Dapper is a micro ORM library for .NET and .NET Core applications that allows you to execute SQL queries and map the results to objects. D...
-
Effect-hooks We have already used state hooks that were introduced along with React version 16.8.0 , which provide state to React compo...
-
Image processing Image processing is a method to perform some operation on an image, in order to get an enhanced image or to extract some us...
-
What is image processing? Image processing is a method to perform some operations on an image, in order to get an enhanced image or to extr...