Im trying to simply get all of the recent questions using Windows Phone 7.
But I keep getting an ObjectDisposedException
My Code is not complicated:
public void BeginGetAllRecentQuestions()
{
_context.Options.LazyLoadingEnabled(true);
_context.Initialized += ContextInitialised;
_context.Initialize(true);
}
private void ContextInitialised(object sender, EventArgs e)
{
QuestionsQuery questionsQuery = _context.Official.StackOverflow.Questions.PageSize(20);
if (GotAllRecentQuestions != null)
GotAllRecentQuestions(questionsQuery.Sort(QuestionSort.Creation).Order(SortOrder.Desc).ToList());
}
private void QuestionsReceived(List<Question> questions)
{
Debug.WriteLine(questions.Count);
this.RecentQuestions = questions;
}
And thats it, but I keep getting the exception, with the stack trace:
at System.Threading.EventWaitHandle.Set() at Soapi.ApiContext.<>c_DisplayClass12.b_e(IAsyncResult a) at System.Net.Browser.ClientHttpWebRequest.<>c_DisplayClassd.b_b(Object state2) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring()
which means nothing to me...
any ideas?