You didn't post the return, but I guess you could split the string of makes by the semicolon character ';'
using the Split()
method, and return an array of individual makes for each record.
Here's an example:
public Task<JsonResult> GetTruckMakes()
{
var results = _context.Details
.Select(x => new
{
id = x.TruckId,
model = x.Models,
makes = x.Makes.Split(';') // Split the makes string into an array of individual makes
});
return new JsonResult(await results.ToListAsync());
}