Example #1
0
        public List <Song> GetMonthSongChart([FromUri] short year, [FromUri] byte month)
        {
            GetAction <Song> getAction = new GetAction <Song>();

            getAction.AddParameter(new SqlParameter("@year", year));
            getAction.AddParameter(new SqlParameter("@month", month));
            getAction.ProcedureName   = "dbo.Songs_GetMonth";
            getAction.IDataRecordFunc = Song.FromDataRecord;
            return(getAction.Execute());
        }
Example #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());
        }
Example #3
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());
        }
Example #4
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);
            }
        }
Example #5
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();
        }