private async Task ValidateCourse(int id) { var author = await courseRapository.GetCoursesAsync(id); if (author == null) { throw new NotFoundException("invalid course to delete"); } courseRapository.DetachEntity(author); }
private async Task ValidateArea(int id) { var author = await areaRapository.GetAreaAsync(id); if (author == null) { throw new NotFoundException("invalid area to delete"); } areaRapository.DetachEntity(author); }