Can u please help me?
I've project in ASP.NET CORE API where is a database of exams. I need filter it by class. For example: I have a list of exams for whole school and i want to display JSON for only one class exams.
I wrote code from: Microsoft Docs (https://learn.microsoft.com/cs-cz/aspnet/core/web-api/advanced/formatting?view=aspnetcore-3.1) but my Visual Studio didn't recognised "GetByNameSubstring". What can I do?
//GET: api/authors/search?namelike=th
[HttpGet("Search")]
public IActionResult Search(string namelike)
{
var result = _context.GetByNameSubstring(namelike);
if (!result.Any())
{
return NotFound(namelike);
}
return Ok(result);
}