Reputation: 7
I have used the same on a different Controller in the same folder. but this should not affect this? When i run the code it shows a SQLite error 1 message
My goal is to have the user to fill in a form and the input is transfered to the Database.
namespace findAMusicianApi.Controllers {
[ApiController]
[Route("[controller]")]
public class MissionsController : ControllerBase{
private readonly FindAMusicianContext _context;
private readonly IWebHostEnvironment _hosting;
public MissionsController( FindAMusicianContext context, IWebHostEnvironment hosting ){
_context = context;
_hosting = hosting;
}
[HttpGet]
public async Task<IEnumerable<Missions>> Get(){
List<Missions> missionList = await _context.Missions.ToListAsync();
return missionList;
}
Upvotes: 0
Views: 69
Reputation: 26
I guess that the Missions model is the representation of the DB table. The error says that you have a column named "Description" that is not present in the Missions Model.
Make sure that the Missions mode have all the properties needed to the deseralization process.
Upvotes: 1