public ActionResult Edit([Bind(Include = "VacancyID,Title,Description,Responsibilities,Qualifications")] Vacancy vacancy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vacancy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vacancy));
 }
Example #2
0
 public async Task DeleteAsync(int id)
 {
     using (var db = new VacancyDbContext(DbConfig))
     {
         var entry = db.Entry(new UserDo {
             Id = id
         });
         entry.State = EntityState.Deleted;
         await db.SaveChangesAsync();
     }
 }