Exemple #1
0
        public List <GenreBase> toListOfGenreBase(List <Models.Genre> genres)
        {
            List <GenreBase> gls = new List <GenreBase>();

            foreach (var item in genres)
            {
                GenreBase gf = new GenreBase();
                gf.GenreId = item.Id;
                gf.Name    = item.Name;
                gls.Add(gf);
            }
            return(gls);
        }
Exemple #2
0
        public IEnumerable <GenreBase> getListOfGenreBase()
        {
            var genres = dc.Genres.OrderBy(g => g.Name);

            if (genres == null)
            {
                return(null);
            }

            List <GenreBase> gfls = new List <GenreBase>();

            foreach (var item in genres)
            {
                GenreBase g = new GenreBase();
                g.GenreId = item.Id;
                g.Name    = item.Name;
                gfls.Add(g);
            }

            return(gfls);
        }