© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
6 replies
Mon AFK

Please help me with this Route

using Northwind.Models;
using Northwind.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Northwind.Dto;
using AutoMapper;
using Northwind.Repository;
using Microsoft.EntityFrameworkCore;


namespace Northwind.Controllers
{
public class EmployeeController
{

[ApiController]
[Route("api/[controller]")]

public class EmployeeControllers : ControllerBase
{
NorthwindContext db = new NorthwindContext();
private readonly IEmployeeRepository _employeeRepository; // Use interface for dependency injection
private readonly NorthwindContext context;

public EmployeeControllers(IEmployeeRepository employeeRepository, NorthwindContext context) // Inject repository in constructor
{
_employeeRepository = employeeRepository;
this.context = context;
}

[HttpGet]
[ProducesResponseType(200)]
public IActionResult GetEmployees()
{
var employees = _employeeRepository.GetEmployees();

if (!ModelState.IsValid)
return BadRequest(ModelState);
return Ok(employees);
}
}
}
}

I dont know how to solve it, if you have any idea, i'm really apriciate
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Someone help me with this question please
C#CC# / help
3y ago
Please Help Me Fix this
C#CC# / help
3y ago
❔ Can you help me with this exercies please.
C#CC# / help
3y ago