I am using Attribute routing. I need both the assemblies reference. I've tried, but not worked for me. Does anyone know how to fix this? Here is my Controller code: Namespaces
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Task1CRUD.Repository;
using Task1CRUD.Model;
namespace Task1CRUD.Controllers
{
[Route("api/[Controller]")]
[ApiController]
public class CustomerController:Controller
{
private readonly ICustomerRepository _customerRep;
public CustomerController(ICustomerRepository customerRepository)
{
_customerRep = customerRepository;
}
// GET api/values
[HttpGet("")]
public async Task<List<Customer>> GetCustomers()
{
return await _customerRep.GetCustomers();
}
}
}