예제 #1
0
 public IActionResult Activate(int id)
 {
     try
     {
         Log.Information($"Attempting to Activate class: {id}");
         var @class = _classService.Activate(id);
         Log.Information($"Successfully Activated class {id}");
         var classDto = _mapper.Map <ClassDto>(@class);
         classDto.IsOwner = true;
         return(Ok(classDto));
     }
     catch (AppException ex)
     {
         return(BadRequest(ex.Message));
     }
 }