InvalidCastException: Unable to cast object of type 'Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1[System.String]' to type 'System.Collections.Generic.IEnumerable
1[motor_backend.Models.EbimaCarMakesAndModel]'.
var data = (from dbo in context.EbimaCarMakesAndModels where dbo.Listed == "Y" select dbo.CarMake).Distinct().OrderBy(name => name)
What 'data' contains after the query is 'string' data, and it's not a collection of motor_backend.Models.EbimaCarMakesAndModel objects.
the 'select dbo.CarMake' is maybe just returning 'name' data -- string.
var data = (from dbo in context.EbimaCarMakesAndModels.where(a => a.Listed == "Y").Distinct(a => a.CarMake).OrderBy(a => a.name)) select dbo).ToList();
It's going to be something like above using Linq and lambda expressions. You may have to play with the syntax a little bit.
https://www.c-sharpcorner.com/article/writing-complex-queries-using-linq-and-lambda/