| | | 1 | | using System.Collections.Generic; |
| | | 2 | | using Microsoft.AspNetCore.Mvc; |
| | | 3 | | using SampleDotNetCore2RestStub.Attributes; |
| | | 4 | | using SampleDotNetCore2RestStub.Models; |
| | | 5 | | using SampleDotNetCore2RestStub.Repositories; |
| | | 6 | | |
| | | 7 | | namespace SampleDotNetCore2RestStub.Controllers |
| | | 8 | | { |
| | | 9 | | [ServiceFilter(typeof(AuthenticationFilterAttribute))] |
| | | 10 | | public class SecurePersonController : Controller |
| | | 11 | | { |
| | | 12 | | private readonly IPersonRepository _personRepository; |
| | | 13 | | |
| | 0 | 14 | | public SecurePersonController(IPersonRepository personRepository) |
| | | 15 | | { |
| | 0 | 16 | | _personRepository = personRepository; |
| | | 17 | | } |
| | | 18 | | |
| | | 19 | | [HttpGet("secure/person/all")] |
| | | 20 | | public List<Person> GetPersons() |
| | | 21 | | { |
| | 0 | 22 | | return _personRepository.GetAll(); |
| | | 23 | | } |
| | | 24 | | } |
| | | 25 | | } |