Пример #1
0
        public async Task <IActionResult> GetAll()
        {
            var operationResult = await songService.GetAll();

            if (!operationResult.IsSuccess)
            {
                return(NotFound(operationResult.Message));
            }
            return(Ok(operationResult.Result));
        }
Пример #2
0
        public ActionResult <IEnumerable <Song> > GetSongs()
        {
            var result = _songService.GetAll();

            if (!result.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result.ResultData));
        }
Пример #3
0
        public async Task <IEnumerable <Song> > Get(string categoryId, string artistId)
        {
            if (!string.IsNullOrEmpty(categoryId))
            {
                return(await _songService.GetByCategory(categoryId));
            }

            if (!string.IsNullOrEmpty(artistId))
            {
                return(await _songService.GetByArtist(artistId));
            }

            return(await _songService.GetAll());
        }
Пример #4
0
        public async Task Load()
        {
            Songs = await _songService.GetAll();

            SongCategories = await _songCategoryService.GetAll();

            CategoryListActive     = new List <int>();
            PlaylistItemUCMockData = new List <PlaylistItemUC>();

            LoadCategory();

            SetStatusFilter(false);

            LoadPlaylistItem(new Action <bool>(SetStatusFilter));
        }
Пример #5
0
        new public async Task Load()
        {
            Songs = await _songService.GetAll();

            SongCategories = new Dictionary <int, string>();
            foreach (var item in await _songCategoryService.GetAll())
            {
                SongCategories.Add(item.ID, item.DisplayName);
            }

            LoadListView();
            if (Songs.Count > 0)
            {
                CurrentSong = Songs[0];
                LoadDetail();
            }
        }
Пример #6
0
        // Load item from  Static

        new public async Task Load()
        {
            flpPlaylist.Size     = new Size(flpPlaylist.Size.Width, flpPlaylist.Size.Height + 300);
            flpFavoriteList.Size = new Size(flpFavoriteList.Size.Width, flpFavoriteList.Size.Height + 300);

            Songs = await _songService.GetAll();

            SongCategories = await _songCategoryService.GetAll();

            CategoryListActive      = new List <int>();
            PlaylistItemPUCMockData = new List <PlaylistItemPUC>();

            LoadCategory();

            SetStatusFilter(false);

            LoadPlaylistItem(new Action <bool>(SetStatusFilter));
        }
 public ActionResult <IEnumerable <Song> > Get()
 {
     return(Ok(songService.GetAll().Select(s => new SongDTO(s)).ToList()));
 }
Пример #8
0
 public IQueryable <Song> GetAll()
 {
     return(_songService.GetAll());
 }
Пример #9
0
        public IActionResult GetAll()
        {
            var response = _service.GetAll();

            return(Ok(response));
        }