public HttpResponseMessage AddGameToPlayground(PlaygroundGame playgroundGame) { bool success = playgroundBusiness.AddGameToPlayGround(playgroundGame); HttpResponseMessage response = success ? Request.CreateResponse(HttpStatusCode.Created, success) : Request.CreateResponse(HttpStatusCode.InternalServerError, "Eror adding game to playground"); return(response); }
public HttpResponseMessage RemoveeGameFromPlayground([FromUri] PlaygroundGame playgroundGame) { bool success = playgroundBusiness.RemoveGameFromPlayground(playgroundGame); HttpResponseMessage response = success ? Request.CreateResponse(HttpStatusCode.Created, success) : Request.CreateResponse(HttpStatusCode.InternalServerError, "Eror removing game from playground"); return(response); }
public bool RemoveGameFromPlayground(PlaygroundGame playgroundGame) { bool retVal = true; try { Uow.PlaygroundGames.Delete(playgroundGame); Uow.Commit(); } catch (Exception ex) { log.Error(String.Format("Erorr delete game from palyground, gameID: {0}, playgroundID: {1}", playgroundGame.GameID, playgroundGame.PlaygroundID), ex); retVal = false; } return(retVal); }
public bool AddGameToPlayGround(PlaygroundGame playgroundGame) { bool retVal = true; try { Uow.PlaygroundGames.Add(playgroundGame); Uow.Commit(); } catch (Exception ex) { log.Error(String.Format("Erorr adding game to palyground, gameID: {0}, playgroundID: {1}", playgroundGame.GameID, playgroundGame.PlaygroundID), ex); retVal = false; } return(retVal); }