Exemplo n.º 1
0
        public async Task Delete(Guid id)
        {
            var faculty = await repository.GetById(id);

            repository.Delete(faculty);
            await repository.SaveChanges();
        }
        public ActionResult DeleteConfirmed(Faculty faculty)
        {
            repository.Delete(faculty.Id);

            TempData["message"] = "Факультет успешно удален";

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public void DeleteFaculty(Faculty faculty)
 {
     using (var scope = Db.BeginWork())
     {
         var baseFaculty = _facultyRepository.Get(u => u.Id == faculty.Id);
         if (baseFaculty != null)
         {
             _facultyRepository.Delete(baseFaculty);
             scope.SaveChanges();
         }
     }
 }
Exemplo n.º 4
0
        public bool Delete(long id)
        {
            bool isDeleted = false;

            try
            {
                facultyRepository.Delete(id);
                isDeleted = true;
            }
            catch (Exception e) {}

            return(isDeleted);
        }
Exemplo n.º 5
0
 public bool Delete(Faculty entity)
 {
     return(_facultyRepository.Delete(entity));
 }
Exemplo n.º 6
0
 public async Task Delete(int facultyId)
 {
     await _facultyService.Delete(facultyId);
 }
Exemplo n.º 7
0
 public IActionResult DeleteFaculty(int id)
 {
     return(new JsonResult(_facultyRepository.Delete(id)));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Удаляет факультет.
 /// </summary>
 /// <param name="id">Идентификатор.</param>
 public void Delete(int id)
 {
     _facultyRepository.Delete(id);
 }
 public void Delete(int facultyId)
 {
     _facultyRepository.Delete(facultyId);
     _db.SaveChanges();
 }
Exemplo n.º 10
0
 public void Delete(Faculty faculty)
 {
     _facultyRepository.Delete(faculty);
 }