Sending Emails in ASP.NET Core 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..
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