/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Security/samples/CustomPolicyProvider/Controllers/HomeController.cs
30 строк
807 B
Pranav K
Use file scoped namespaces (#38076)
06 ноя 2021, 03:52
Не верифицирован
06 ноя 2021, 03:52
a450cb6
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.Mvc; namespace CustomPolicyProvider.Controllers; // Sample actions to demonstrate the use of the [MinimumAgeAuthorize] attribute [Controller] public class HomeController : Controller { public IActionResult Index() { return View(); } // View protected with custom parameterized authorization policy [MinimumAgeAuthorize(10)] public IActionResult MinimumAge10() { return View("MinimumAge", 10); } // View protected with custom parameterized authorization policy [MinimumAgeAuthorize(50)] public IActionResult MinimumAge50() { return View("MinimumAge", 50); } }