public static Game ToGame(this GameDto gameDto) { if (!MongoIdValidator.Check(gameDto.id)) { gameDto.id = ObjectId.Empty.ToString(); } return(new Game { Id = new ObjectId(gameDto.id), Title = gameDto.title, Genre = gameDto.genre }); }
private bool CheckId(string id) { return(MongoIdValidator.Check(id)); }