public async Task <ICollection <Notification> > GetNotifications() { var azureclient = _azureClient.GetClient(Globals.NOTIFICATION, string.Empty, string.Empty); var table = _cloudService.GetTable <Notification>(azureclient); var list = await table.ReadAllItemsAsync(); return(list); }
public async Task <DS.User> RegisterUser(DS.User userData) { var azureclient = _azureClient.GetClient(Globals.USER_API, string.Empty, string.Empty); var table = _cloudService.GetTable <DS.User>(azureclient); var list = await table.CreateItemAsync(userData); return(list); }
public JsonResult Index() { var vms = _azureClient.GetClient().VirtualMachines.List().ToList().Select(s => s.Name); return(Json(vms, new JsonSerializerSettings() { Formatting = Formatting.Indented })); }
public async Task <List <PurchaseOrder> > GetPurchaseOrders() { var azureclient = _azureclient.GetClient(Globals.PURCHASE_ORDER, Globals.PURCHASEORDERS_KEY, Globals.DATE); var table = _cloudService.GetTable <PurchaseOrder>(azureclient); var list = await table.ReadAllItemsAsync(); return(list == null ? null : list.ToList()); }
public async Task <ICollection <Event> > GetEvents() { var azureclient = _azureClient.GetClient(Globals.EVENT, Globals.EVENT_KEY, string.Empty); var table = _cloudService.GetTable <Event>(azureclient); var list = await table.ReadAllItemsAsync(); return(list); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAzureClient client) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); app.Run(async(context) => { var azureClient = client.GetClient(); var vms = azureClient.VirtualMachines.List().ToList()[0]; await context.Response.WriteAsync(vms.Name); }); }