예제 #1
0
        public string TagList(int gameId)
        {
            string taglist = "";

            using (var db = new GameManagerContext())
            {
                var list = db.Games.Where(u => u.Id == gameId).
                           SelectMany(
                    g => g.Tags, (tag, game) =>
                    new GameTagDTO
                {
                    Tags = game.Name
                }).ToList();

                foreach (GameTagDTO game in list)
                {
                    taglist += game.Tags + ", ";
                }
                if (taglist.Length > 0)
                {
                    taglist = taglist.Substring(0, taglist.Length - 2);
                }
            }
            return(taglist);
        }
예제 #2
0
        public string GenreList(int gameId)
        {
            string genrelist = "";

            using (var db = new GameManagerContext()){
                var list = db.Games.Where(u => u.Id == gameId).
                           SelectMany(
                    g => g.Genre, (genre, game) =>
                    new GameGenreDTO
                {
                    Genres = game.Name
                }).ToList();

                foreach (GameGenreDTO game in list)
                {
                    genrelist += game.Genres + ", ";
                }
                if (genrelist.Length > 0)
                {
                    genrelist = genrelist.Substring(0, genrelist.Length - 2);
                }
            }
            return(genrelist);
        }
예제 #3
0
 protected RepositoryBase(GameManagerContext applicationDbContext)
 {
     _applicationDbContext = applicationDbContext;
 }
예제 #4
0
 public FriendRepository(GameManagerContext applicationDbContext)
     : base(applicationDbContext)
 {
 }
 public GameBorrowedRepository(GameManagerContext applicationDbContext)
     : base(applicationDbContext)
 {
 }