示例#1
0
        public ISong GetRandomSong(int songId)
        {
            IDataQuery query = new DataQuery();

            query.Where   = string.Format("songId <> {0}", songId);
            query.OrderBy = " NEWID() ";
            ISong song = _songRepository.GetTop(1, query)[0];

            return(song);
        }
示例#2
0
        public IArtist GetRandomArtist(int idArtist)
        {
            IDataQuery query = new DataQuery();

            query.Where   = string.Format("artistId <> {0}", idArtist);
            query.OrderBy = " NEWID() ";
            IArtist artist = _artistRepository.GetTop(1, query)[0];

            return(artist);
        }
示例#3
0
        private DateTime GetLastBattlTime()
        {
            IDataQuery query = new DataQuery();

            query.OrderBy = " battlId DESC ";

            IBattl         battl      = new Battl();
            IList <IBattl> collection = _battlRepository.GetTop(1, query);

            if (collection.Count == 0)
            {
                battl.EndTime = DateTime.Now;
            }
            else
            {
                battl.EndTime = collection[0].EndTime;
            }

            return(battl.EndTime);
        }