public IHttpActionResult EndBidding(int id) { try { lotService.EndBidding(id); return(Ok("Bidding finished successfuly")); } catch (NotFoundException) { return(NotFound()); } catch (InvalidOperationException e) { return(BadRequest(e.Message)); } }