I am trying to implement a custom authorization requirement following a tutorial. It seems like
context.Resource no longer contains AuthorizationFilterCo
Changes in startup.cs if you are using Rout attribute in controllers You can replace this
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "home",
pattern: "{controller=Home}");
});
with this in Configure()
app.UseMvc(routes =>
{
routes.MapRoute(
name: "home",
template: "{controller=Home}");
});
and disable endpoint routing with this in ConfigureSevices()
services.AddMvc().AddMvcOptions(mvcopt=> { mvcopt.EnableEndpointRouting = false;});
Works in Asp .Net Core 5 as well