I used entity framework 6.1 for the default connection string from wcf service. In which i want to get the details of user when the user logins has taken from the database using EF 6.1.
But i am facing problem not connecting to the database and not getting the data from the database.
What I have tried:
var objUser = (from u in dbContext.Users
where u.UserName.Equals(user.UserName)
select u).FirstOrDefault();
From this i am not getting the data from the database saying the data has not been connected.
Here dbContext is an object instance for the database entity like
public partial class projectentity : DbContext
{
}
this class is from edmx file and projectentity object dbContext called at some other class outside the project but it is in the same solution....
Now the error point of view i am getting like this...
'dbContext.Users.Local' threw an exception of type 'System.InvalidOperationException'
Can anyone explain me this point. Thanks in advance