public IHttpActionResult DeleteLecturer(int id)
      {
          Lecturer Lecturer = lecturerRepo.Get(id);

          if (Lecturer == null)
          {
              return(NotFound());
          }

          lecturerRepo.Remove(Lecturer);
          lecturerRepo.Save();

          return(Ok(Lecturer));
      }
Пример #2
0
        public async Task <IActionResult> DeleteLecturer(int id)
        {
            var lecturer = await repository.GetLecturer(id, includeRelated : false);

            if (lecturer == null)
            {
                return(NotFound());
            }

            repository.Remove(lecturer);
            await unitOfWork.CompleteAsync();

            return(Ok(id));
        }