public IActionResult Delete(Guid id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id == Guid.Empty) { return(BadRequest("Guid is empty.")); } try { _repository.DeleteSession(id); return(StatusCode(204)); } catch (IndexOutOfRangeException) { return(NotFound()); } }
public void DeleteSession(int id) { _sessionRepository.DeleteSession(id); }
public IActionResult DeleteSession(Guid sessionid) { sessionsRepository.DeleteSession(sessionid); return(Json("")); }