public async Task <T> Update(T entity)
        {
            context.Update(entity);

            await SaveChangesAsync();

            return(entity);
        }
예제 #2
0
        public IActionResult Edit(Make make)
        {
            if (ModelState.IsValid)
            {
                _dataContext.Update(make);
                _dataContext.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(make));
        }
예제 #3
0
        public IActionResult EditPost()
        {
            if (!ModelState.IsValid)
            {
                return(View(ModelVM));
            }

            _dataContext.Update(ModelVM.Model);
            _dataContext.SaveChanges();

            return(RedirectToAction("Index"));
        }
예제 #4
0
 public void Save(T entity)
 {
     _dataContext.Update(entity);
 }