public IHttpActionResult Create([FromBody] XboxCreateModel xboxToCreate) { _xboxService = new XboxService(); _xboxService.CreateXboxGame(xboxToCreate); return(Ok($"{xboxToCreate.Name} has been successfully created!")); }
public IHttpActionResult Create([FromBody] XboxCreateModel xboxToCreate) { _xboxService = new XboxService(); _xboxService.CreateXboxGame(xboxToCreate); return(Ok()); }
public IHttpActionResult Delete([FromUri] int xboxId) { if (ModelState.IsValid) { _xboxService = new XboxService(); _xboxService.DeleteXboxGame(xboxId); return(Ok($"XboxGame # {xboxId} has been successfully deleted.")); } return(BadRequest("Wrong ID# entered, please try again.")); }
public IHttpActionResult Update([FromBody] XboxUpdatesModel xboxToUpdate) { if (ModelState.IsValid) { _xboxService = new XboxService(); _xboxService.UpdateXboxGame(xboxToUpdate); return(Ok($"{xboxToUpdate.Name} has been successfully updated.")); } return(BadRequest("Cannot find game to update, please try again.")); }
public IHttpActionResult List() { _xboxService = new XboxService(); return(Ok(_xboxService.GetAllXboxGames())); }
public IHttpActionResult Get([FromUri] int xboxId) { _xboxService = new XboxService(); return(Ok(_xboxService.GetXboxGame(xboxId))); }