Пример #1
0
 public Game Create(Game game)
 {
     var output = _db.Games.Insert(game);
     var outputGame = (Game)output;
     outputGame.Id = output._id;
     return outputGame;
 }
Пример #2
0
 public Game Save(Game game)
 {
     if (game.Id != ObjectId.Empty)
         return Update(game);
     else
         return Create(game);
 }
Пример #3
0
 public Game Update(Game game)
 {
     _db.Games.Update(game);
     return Get(game.Id);
 }
Пример #4
0
 public Game Update(string id, Game game)
 {
     game.Id = new ObjectId(id);
     return Update(game);
 }
Пример #5
0
 public GameDto(Game game)
 {
     id = game.IdAsString;
     title = game.Title;
     genre = game.Genre;
 }