public Operation <ServerModel> UpdateServer(ServerModel model) { return(System.Operation.Create(() => { //model.Validate(); var isExist = _context.Servers.Find(model.ServerID); if (isExist == null) { throw new Exception("service does not exist"); } var entity = model.Edit(isExist, model); _context.Entry(entity); _context.SaveChanges(); return model; })); }