26 lines
656 B
C#
26 lines
656 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using TestApplication.Data;
|
|
using TestApplication.Models;
|
|
|
|
namespace TestApplication.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class ValuesController : ControllerBase
|
|
{
|
|
private readonly Context _context;
|
|
public ValuesController(Context context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
[HttpGet]
|
|
public async Task<ActionResult<IEnumerable<Values>>> GetValues()
|
|
{
|
|
return await _context.Values.ToListAsync();
|
|
}
|
|
}
|
|
} |