public ActionResult EditServer([Bind(Include = "Id,ServerName,AuthenticationType,UserName,Password")] ServerConfig serverConfig) { if (ModelState.IsValid) { db.Entry(serverConfig).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(serverConfig)); }
public async Task UpdateAsync(TAggregateRoot aggregateRoot) { using (var ctx = new ConfigContext()) { ctx.Set <TAggregateRoot>().Attach(aggregateRoot); ctx.Entry(aggregateRoot).State = EntityState.Modified; await ctx.SaveChangesAsync(); } }
public async Task UpdateRangeAsync(IEnumerable <TAggregateRoot> aggregateRoots) { using (var ctx = new ConfigContext()) { foreach (var item in aggregateRoots) { ctx.Set <TAggregateRoot>().Attach(item); ctx.Entry(item).State = EntityState.Modified; } await ctx.SaveChangesAsync(); } }
public String Editar(User model) { using (var db = new ConfigContext()) { this.User.id = model.id; this.User.nombre = model.nombre; this.User.email = model.email; this.User.apellido = model.apellido; this.User.ProfesionFk = model.ProfesionFk; db.Entry(this.User).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); this.User = null; } return("ok"); }