So, I created a new database and a table in SQLEXPRESS, I also filled tables with random information, and I used key word in Nuget console -> Scaffold-DbContext "Server=.\SQLExpress;Database=testdb;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models. The Program successfully created models, so I just wanted to output the information, so I created a new apicontroller, with [HttpGet], and injected the created testdbcontext which was created to get information about the database tables, so In a word I created the following method.
[HttpGet("All")]
public IActionResult GetAll()
{
var obj = _db.Mobiletables.ToList();
return Ok(obj);
}
However, when I go to localhost/home/all I get the following error What am I doing wrong, I just want to read information from the database to api, using DB First Approach method.