ASP.Net Core Error : The JSON value could not be converted to System.String
I am trying to perform a search functionality in Asp.net core, this is my controller [HttpPost("searchbyname")] public async Task<ActionResult<List<SelectedChildDto>>> SearchByName([FromBody]string firstName) { if (string.IsNullOrWhiteSpace(firstName)) { return new List<SelectedChildDto>(); } return await _context.Children .Where(x => x.FirstName.Contains(firstName)) .OrderBy(x => x.FirstName) .Select(x =>…