public async Task <ActionResult> DeleteConfirmed(int id) { BrokerTable brokerTable = await db.BrokerTables.FindAsync(id); db.BrokerTables.Remove(brokerTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "BrokerId,FirstName,LastName,City,Address,MobileNumber,RegistrationDate,Status")] BrokerTable brokerTable) { if (ModelState.IsValid) { db.Entry(brokerTable).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(brokerTable)); }
// GET: BrokerTables/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BrokerTable brokerTable = await db.BrokerTables.FindAsync(id); if (brokerTable == null) { return(HttpNotFound()); } return(View(brokerTable)); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public async void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMetricServer(); app.UseWebSockets(new WebSocketOptions { KeepAliveInterval = TimeSpan.FromSeconds(120), ReceiveBufferSize = 4 * 1024 }); app.Use(async(context, next) => { if (context.Request.Path == "/ws") { if (context.WebSockets.IsWebSocketRequest) { var webSocket = await context.WebSockets.AcceptWebSocketAsync(); await new MessageHandler().Handle(context, webSocket); } else { context.Response.StatusCode = 400; } } else { await next(); } }); var client = env.IsDevelopment() ? new EtcdClient("http://localhost") : new EtcdClient("http://etcd"); var me = Guid.NewGuid().ToString(); var brokerTable = new BrokerTable(client); await brokerTable.ImHere(); var topicList = new TopicList(client, me); await topicList.SetupTopicListWatch(); }