I have an SQL query using the unpivot function. I want convert this query into a LINQ query
select MvNumber,DocumentName , Expire_Date
From VehicleDetails
Unpivot
(
Expire_Date for DocumentName in ([TaxUpTo] ,[InsuranceUpTo],[PUCUpTo],[FitnessUpTo])
)as p
I want to use this query into asp .net MVC c#, in a controller, in the form of view,
currently, i use this code
public ActionResult Index()
{
var list = _vehicleDetailsService.GetAll().OrderBy(x => x.MvNumber);
return View(list);
}