Beispiel #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            var parameter     = (ValueTuple <Query, string>)e.Parameter;
            var documentStore = new KeyValueStoreDatabaseService(SharedLogic.Instance.DatabasePath, "Tracks");

            _recordType = parameter.Item2;
            switch (parameter.Item2)
            {
            case "Toasts":
                LibraryService libraryService = new LibraryService(documentStore);
                searchResultsList.ItemsSource = await libraryService.Query(parameter.Item1.QueryWord);

                break;

            case "Bakers":
                searchResultsList.ItemsPanel = this.Resources["BreadsBakersPanel"] as ItemsPanelTemplate;
                AlbumArtistService artistService = new AlbumArtistService(documentStore);
                searchResultsList.ItemsSource = await artistService.QueryArtistsAsync(parameter.Item1.QueryWord);

                break;

            case "Breads":
                searchResultsList.ItemsPanel = this.Resources["BreadsBakersPanel"] as ItemsPanelTemplate;
                AlbumArtistService albumService = new AlbumArtistService(documentStore);
                searchResultsList.ItemsSource = await albumService.QueryAlbumsAsync(parameter.Item1.QueryWord);

                break;
            }
            UpdateTemplate(Window.Current.Bounds.Width);
        }
        /// <summary>
        /// Get a list of joiner tables that join artists and albums
        /// </summary>
        /// <returns></returns>
        public IHttpActionResult Get()
        {
            AlbumArtistService albumArtistService = CreateAlbumArtistService();
            var albumArtists = albumArtistService.GetAlbumArtists();

            return(Ok(albumArtists));
        }
Beispiel #3
0
 public void InitDb()
 {
     AlbumArtistService = new AlbumArtistService(new KeyValueStoreDatabaseService(SharedLogic.Instance.DatabasePath, "Albums"));
 }
 public void InitDb()
 {
     AlbumArtistService = new AlbumArtistService(new DocumentStoreDatabaseService(SharedLogic.DatabasePath, "Albums"));
 }
        /// <summary>
        /// Creates a link between albumID and artistID
        /// </summary>
        /// <returns></returns>
        private AlbumArtistService CreateAlbumArtistService()
        {
            var albumArtistService = new AlbumArtistService();

            return(albumArtistService);
        }