I need to get only one value from the table, I do it like this:
public DBEntities db = new DBEntities();
public ObservableCollection<Users> GetUsers
{
get { return db.Users.Local; }
}
public WindowViewModel(Label userName)
{
var us = GetUsers.Where(u => u.Id == 1) as Users;
userName = us.Name.ToString();
}
But it does not work out the error: Additional information: The object reference does not point to an instance of the object.