
Hosting ASP.NET Core Web Application in IIS
In this article, let's see how we can host our ASP.NET Core application in IIS and how to troubleshoot some of the most commonly faced issues.
In this article, let's see how we can host our ASP.NET Core application in IIS and how to troubleshoot some of the most commonly faced issues.
In this article, let's try integrating an ASP.NET Core (.NET 6) application with an existing SQL database and understand how "Database First" approach..
In this article, let's see how we can extract rendered HTML content from a RazorView in ASP.NET Core (.NET 6) MVC using RazorViewEngine
In this article, we'll extend our design to add attachments and images to our mail content and send it with MailKit.
In this article, let's see how we can send this HTML content as an Email to users. We'll use MailKit, which is one of the most popular Mail Client lib..
In this article, let's talk about implementing CQRS - Command Query Responsibility Segregation in ASP.NET Core via Mediator pattern by using MediatR library.
Authorization Filters act at the beginning of the request life cycle, before all other filters are executed. It determines if the request is authorized to access the resource or not.
To create an Authorization Filter, one can simply implement the IAuthorizationFilter interface and provide an implementation of the method:
interface IAuthorizationFilter {
OnAuthorization(AuthorizationFilterContext ctx);
}
An ActionFilter can be created in two ways:
IActionFilter contains two methods, that the custom Action Filter needs to implement:
OnActionExecuting(ActionExecutingContext ctx) - before action is executed
OnActionExecuted(ActionExecutedContext ctx) - after action is executed
ActionFilterAttribute abtract class has the below methods which can be overriden as required:
OnActionExecuting(ActionExecutingContext ctx) - before action is executed
OnActionExecuted(ActionExecutedContext ctx) - after action is executed
OnResultExecuting(ResultExecutingContext ctx) - before the ActionResult instance is invoked
OnResultExecuted(ResultExecutedContext ctx) - after the ActionResult instance is invoked
Here are some differences between ViewBag, ViewData and TempData when used in an ASP.NET Core MVC application.