public DoctorClass GetById(int id)
{
using (var context = new EmrContext())
{
var query = from d in context.Doctors
join c in context.Users on d.Id equals c.Id
where d.Id==id
select new DoctorClass { Email = c.Email, FirstName = c.FirstName, LastName = c.LastName, Post = d.Post };
return query;
}
}
エラーは次のとおりです。タイプ「System.Linq.IQueryable」を「Mvc.Models.DoctorClass」に暗黙的に変換することはできません。明示的な変換が存在します(キャストがありませんか?)
この問題を解決するには、「クエリ」で何をする必要がありますか?