I'm trying to return a value using LINQ but instead I'm returning the actual query.
Here is my code:
var email = from p in dbContext.People
where p.UserId == UserId
select new { p.Email };
Contact.Email = email.ToString();
I want to get the actual email address of the user but instead I'm getting the query string back.
"SELECT [Extent1].[UserId] AS [UserId], [Extent1].[Email] AS [Email]
FROM [dbo].[Person] AS [Extent1] WHERE [Extent1].[UserId] = @p__linq__0"