Пример #1
0
        public List <Song> GetTopSongsByDurationChart()
        {
            GetAction <Song> getAction = new GetAction <Song>();

            getAction.ProcedureName   = "dbo.Songs_GetTopByDuration";
            getAction.IDataRecordFunc = Song.FromDataRecord;
            return(getAction.Execute());
        }
Пример #2
0
        public List <Song> GetArtistSongChart([FromUri] int artist)
        {
            GetAction <Song> getAction = new GetAction <Song>();

            getAction.AddParameter(new SqlParameter("@artistId", artist));
            getAction.ProcedureName   = "dbo.Songs_GetArtist";
            getAction.IDataRecordFunc = Song.FromDataRecord;
            return(getAction.Execute());
        }
Пример #3
0
        public List <Song> GetYearSongChart([FromUri] short year)
        {
            GetAction <Song> getAction = new GetAction <Song>();

            getAction.AddParameter(new SqlParameter("@year", year));
            getAction.ProcedureName   = "dbo.Songs_GetYear";
            getAction.IDataRecordFunc = Song.FromDataRecord;
            return(getAction.Execute());
        }
Пример #4
0
        public List <Song> GetDecadeSongChart([FromUri] short decade)
        {
            GetAction <Song> getAction = new GetAction <Song>();

            getAction.AddParameter(new SqlParameter("@decade", decade));
            getAction.ProcedureName   = "dbo.Songs_GetDecade";
            getAction.IDataRecordFunc = Song.FromDataRecord;
            return(getAction.Execute());
        }
Пример #5
0
        public Artist Get([FromUri] int id)
        {
            GetAction <Artist> getAction = new GetAction <Artist>();

            getAction.AddParameter(new ActionParameter("@id", id));
            getAction.ProcedureName   = "dbo.Artists_GetOne";
            getAction.IDataRecordFunc = Artist.FromDataRecord;

            List <Artist> hits = getAction.Execute();

            if (hits.Count == 1)
            {
                return(hits[0]);
            }
            else
            {
                return(null);
            }
        }
Пример #6
0
        public Song Get([FromUri] int id)
        {
            GetAction <Song> getAction = new GetAction <Song>();

            getAction.AddParameter(new SqlParameter("@id", id));
            getAction.ProcedureName   = "dbo.Songs_GetOne";
            getAction.IDataRecordFunc = Song.FromDataRecord;

            List <Song> hits = getAction.Execute();

            if (hits.Count == 1)
            {
                return(hits[0]);
            }
            else
            {
                return(null);
            }
            //return new Song();
        }