Add APIKey authentication
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TodoApi.Helpers;
|
||||
using TodoApi.Models;
|
||||
|
||||
namespace TodoApi.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class TodoItemsController : ControllerBase
|
||||
[ApiKey]
|
||||
public class TodoItemsController(TodoContext context) : ControllerBase
|
||||
{
|
||||
private readonly TodoContext _context;
|
||||
|
||||
public TodoItemsController(TodoContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
private readonly TodoContext _context = context;
|
||||
|
||||
// GET: api/TodoItems
|
||||
[HttpGet]
|
||||
|
||||
Reference in New Issue
Block a user