I'm very new to Entity Framework. I'm trying to use it to query the database, and I want to set a string equal to the result of that query.
Here's the code I'm using:
string UserId = (db.StudentModel.Where(b => b.UserName == strCert)).ToString();
Now, obviously this sets UserId equal to the query. How do I set UserId equal to the result?