Twitter DataContext

The TwitterDataContext class is the proxy to the Twitter local database and includes two public Table<TSource> properties: TwitterUsers and TimelineItems (see Listing 29.3).

The assignment of the DataContext.Log property allows you to monitor the activities of the DataContext at runtime, and in particular, to observe the generated SQL as it is being sent to the database. This customized logging is examined later in the chapter.

The GetTable property of the DataContext class retrieves a Table<TEntity> object representing a table in the underlying database. Table objects can be queried using LINQ to SQL.

LISTING 29.3. TwitterDataContext Class

public class TwitterDataContext : DataContext{    

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.