Ejemplo n.º 1
0
 public AlbumModalService()
 {
     _context      = new SoulfulContext();
     _singerRepo   = new SoulfulRepository <Singer>(_context);
     _albumRepo    = new SoulfulRepository <Album>(_context);
     _languageRepo = new SoulfulRepository <Language>(_context);
 }
Ejemplo n.º 2
0
        public List <AlbumViewModel> GetModalinform()
        {
            SoulfulBackStage           context          = new SoulfulBackStage();
            SoulfulRepository <Singer> SingerRepository = new SoulfulRepository <Singer>(context);
            SoulfulRepository <Album>  AlbumRepository  = new SoulfulRepository <Album>(context);

            var albumContext = from Album in AlbumRepository.GetAll()
                               join Singer in SingerRepository.GetAll()
                               on Album.Singer_id equals Singer.Singer_id
                               select new AlbumViewModel
            {
                Album_Name = Album.Album_Name,
                About      = Album.About,
                Pic        = Album.Pic,
                Singer     = Singer.Name,
                Singer_id  = Singer.Singer_id,
                Company    = Album.Company,
                Datetime   = Album.Datetime,
                Album_id   = Album.Album_id,
                Price      = Album.Price,
                Hits       = Album.Hits,
                WeekHits   = Album.WeekHits,
                MonthHits  = Album.MonthHits
            };

            return(albumContext.ToList());
        }
Ejemplo n.º 3
0
        public List <HitViewModel> GetMonthHits()
        {
            SoulfulBackStage          context         = new SoulfulBackStage();
            SoulfulRepository <Album> AlbumRepository = new SoulfulRepository <Album>(context);

            var albumContext = from Album in AlbumRepository.GetAll().OrderBy(x => x.Album_Name)
                               orderby Album.MonthHits descending
                               select new HitViewModel
            {
                Name      = Album.Album_Name,
                MonthHits = Album.MonthHits
            };

            return(albumContext.Take(10).ToList());
        }
Ejemplo n.º 4
0
 public AccountService()
 {
     _context    = new SoulfulContext();
     _repository = new SoulfulRepository <GiveBacks>(_context);
 }
Ejemplo n.º 5
0
 public EventService()
 {
     _context    = new SoulfulContext();
     _eventRepo  = new SoulfulRepository <Event>(_context);
     _singerRepo = new SoulfulRepository <Singer>(_context);
 }
Ejemplo n.º 6
0
 public ProductService()
 {
     _context    = new SoulfulContext();
     _singerRepo = new SoulfulRepository <Singer>(_context);
     _albumRepo  = new SoulfulRepository <Album>(_context);
 }
Ejemplo n.º 7
0
 public OrderService()
 {
     _context   = new SoulfulContext();
     _orderRepo = new SoulfulRepository <Order>(_context);
     _odRepo    = new SoulfulRepository <OrderDetail>(_context);
 }