Sunday, 15 August 2010

asp.net - Should I be keeping references to Azure CloudTableClient/CloudTable? -


I am struggling to get some real guidance whether I share objects in Ozre table storage objects in my ASP should do. .NET WebAPI application

For perfection, retrieving an institution from table collection looks like the one below.

When consolidates something in a data layer in such a way where I have a "repository" for example in an application shared, it refers to the CloudTable - context Is safe to keep - to share with future actions - or should I recreate tableClient through CloudTable GetTableReference for each operation? Or maybe recreate CloudTableClient for each operation?

  // Recover archiving account from connection string. CloudStorageAccount ArchiveAccount = Cloud StorageAccount Pars (CloudConfigurationManager.GetSetting ("Storage Connection")); // Create a Client Client Client Table Client Client = Storage ACCOUNT.CreateCloudTableClient (); // Create a CloudTable object representing the "People" table. CloudTable Table = Tableclient. GateTable Reference ("People"); // Create a recovery process that takes the client unit Table operation retrieval = table operation. Retrieve & lt; Customer distance & gt; ("Smith", "Ben"); // execute the recovery operation. Table result received result = table. Acccute (recovery operation); // Print the result phone number (Result result result! = Tap) Console.light line ((customer interval) Recover result. Result) .phone number); Else Console.WriteLine ("The phone number could not be retrieved.");  

On the one hand, any resource / need-reads that will help me answer it or are equally welcome in the future.

It should be ok to share your objects. If you are trying to use different authentication / configurations for different tables, then you need more examples.


No comments:

Post a Comment