using App01.Data; // using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; // using Microsoft.EntityFrameworkCore; namespace App01.Controllers; [Route("api/[controller]")] [ApiController] public class EmployeeController : ControllerBase { private readonly DataService _db; public EmployeeController(DataService db) { _db = db; } [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult> Get() { var emps = _db.Employees.ToList(); return emps == null ? NotFound() : emps; } }