Skip to main content
3 of 4
added 335 characters in body
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

##Soapi.CS Fluent Configuration

var ctx = new ApiContext(ApiKey).Options
    // obviates a call to stackauth
    .SerializedSites("{ 'api_sites': [ {'name': 'Stack....")
    // can also be accomplished by seeding the cache
    .SeedCache(new RequestCacheItem
        {
            Uri = new Uri("http://stackauth.com/1.0/sites"),
            ResponseText = "{ 'api_sites': [ {'name': 'Stack....",
            Expiration = DateTime.Now.AddDays(1)
        })
    .UserAgent("SOAPI.APP")
    // 'stub' objects are fetch individually upon access
    .LazyLoadingEnabled(true)
    // all 'stub' objects for a batch are requests as a batch
    // and pre populated
    .EagerLoadingEnabled(true) //
    .Context // fluent terminator
    .Initialize();
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60