public IEnumerable <DriverLicenseViewModel> GetByDriverC(string driverC) { var source = _driverLicenseRepository.Query(x => x.DriverC == driverC); return(from a in _driverLicenseRepository.GetAllQueryable() join b in _licenseRepository.GetAllQueryable() on a.LicenseC equals b.LicenseC where a.DriverC == driverC select new DriverLicenseViewModel() { DriverC = a.DriverC, LicenseC = a.LicenseC, LicenseN = b.LicenseN, DriverLicenseD = a.DriverLicenseD, DriverLicenseNo = a.DriverLicenseNo, ExpiryD = a.ExpiryD }); }