public IHttpActionResult PutOfferStatus(int id, OfferStatuses status) { OfferModel offerWithUpdatedStatus = offersService.UpdateOfferStatus(id, status); if (offerWithUpdatedStatus == null) { return(NotFound()); } return(Ok(offerWithUpdatedStatus)); }
public OfferModel UpdateOfferStatus(int id, OfferStatuses newStatus) { OfferModel offer = db.OffersRepository.GetByID(id); if (offer != null) { offer.Status = newStatus; db.OffersRepository.Update(offer); db.Save(); } return(offer); }