Question
My project can not see the namespace (asp.net mvc)? The Infrastructure word is underlined in the first line where it is written: using Chegg.Infrastructure; Also
My project can not see the namespace (asp.net mvc)?
- The Infrastructure word is underlined in the first line where it is written:
using Chegg.Infrastructure;
- Also the IStaffRepository is underlined in the next two lines: private readonly IStaffRepository _staffRepository; public HomeController(IStaffRepository staffRepository)
using Chegg.Infrastructure; using Microsoft.AspNetCore.Mvc; namespace Chegg.UI.Controllers { public class HomeController : Controller { private readonly IStaffRepository _staffRepository; public HomeController(IStaffRepository staffRepository) { _staffRepository = staffRepository; } public IActionResult Index() { return View(); } [HttpGet] public IActionResult GetAllStaff() { var staff = _staffRepository.AllStaff(); return Json(staff); } [HttpGet] public IActionResult GetStaffDetails(int id) { var staff = _staffRepository.Get(id); return Json(staff); } } }
My StaffRepository looks this way:
namespace Chegg.Infrastructure; public interface IStaffRepository { Staff Get(int id); } public class StaffRepository : IStaffRepository { public Staff Get(int id) { return AllStaff().First(x => x.Id == id); } private IEnumerable
Could you please help me in details? Maybe I need a file somewhere. May I get a step-by-step description with necessary code-changing, help. Thanks
==============================================================================================================
Main folder:
Chegg.Infrastructure folder
Chegg.UI folder
Chegg.sln Visual Studio Solution
etc.
In the Chegg.Infrastructure folder we can see:
bin folder
obj folder
Chegg.Infrastructure C# Project Source File
StaffRepository.cs C# Source File
etc.
In the Chegg.UI folder we can see the followings:
bin folder
Controllers folder
Models folder
obj folder
Properties folder
Views folder
www.root folder
etc.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started