O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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{    

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required