protected static IQueryable <ChirpEntity> Find() { CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString"); ChirpContext context = new ChirpContext(account.TableEndpoint.ToString(), account.Credentials); return(context.ChirpEntities); }
public static Chirp Add(string username, string text) { CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString"); ChirpContext context = new ChirpContext(account.TableEndpoint.ToString(), account.Credentials); DateTime now = DateTime.UtcNow; context.AddChirp(username, text, now); return(new Chirp(username, text, now)); }