You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
605 B
C#
27 lines
605 B
C#
using EFCore7Study.DataService;
|
|
using EFCore7Study.DataService.Models;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace EFCore7Study.WebApi.Controllers
|
|
{
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class AccountsController : ControllerBase
|
|
{
|
|
private readonly AppDbContext _dbContext;
|
|
|
|
public AccountsController(AppDbContext context)
|
|
{
|
|
_dbContext = context;
|
|
}
|
|
|
|
[HttpGet]
|
|
public List<Account> AllAccounts()
|
|
{
|
|
return _dbContext.Accounts.ToList();
|
|
}
|
|
}
|
|
}
|