Ejemplo n.º 1
0
 public IHttpActionResult AddGame(BoardGame boardgame) {
     if (ModelState.IsValid)
     {
         _bgService.AddGame(boardgame.Name, boardgame.PlayerRange, boardgame.Description, User.Identity.Name);
         return Ok();
     }
     return BadRequest();
 }
Ejemplo n.º 2
0
 public void AddGame(string name, string playerRange, string description, string username)
 {
     var owner = _userrepo.FindByName(username);
     var newboardgame = new BoardGame()
     {
         Name = name,
         PlayerRange = playerRange,
         Description = description,
         Owner = owner
     };
     _bgrepo.AddGame(newboardgame);
 }
Ejemplo n.º 3
0
 public void AddGame(BoardGame boardgame) {
     _db.BoardGames.Add(boardgame);
     _db.SaveChanges();
 }