This should help.
var name = dbo.DoctorsName.Where(item => item.doctorsName = "Foo Bar").Select(item => item.Name).FirstOrDefault();
If there are no entries for your condition, then using FirstOrDefault () may throw an exception. For this you can try -
var namelist = dbo.DoctorsName.Where(item => item.doctorsName = "Foo Bar").Select(item => item.Name); If(namelist.Count() > 0) var name = namelist.Fisrt();
source share