示例#1
0
        public SongInRanking(RankingList poll, Song song, int sortIndex)
        {
            ParamIs.NotNull(() => poll);
            ParamIs.NotNull(() => song);

            Ranking = poll;
            Song = song;
            SortIndex = sortIndex;
        }
示例#2
0
        public SongInRanking(RankingList poll, Song song, int sortIndex)
        {
            ParamIs.NotNull(() => poll);
            ParamIs.NotNull(() => song);

            Ranking   = poll;
            Song      = song;
            SortIndex = sortIndex;
        }
示例#3
0
        public RankingContract(RankingList poll)
        {
            ParamIs.NotNull(() => poll);

            CreateDate = poll.CreateDate;
            Description = poll.Description;
            Id = poll.Id;
            Name = poll.Name;
            NicoId = poll.NicoId;
            Songs = poll.Songs.Select(m => new SongInRankingContract(m)).ToArray();
        }
示例#4
0
        public void CreateWVRPoll(RankingContract contract)
        {
            HandleTransaction(session => {

                var poll = new RankingList(contract);

                foreach (var songContract in contract.Songs) {

                    var c = songContract;
                    var song = session.Query<Song>().FirstOrDefault(s => s.NicoId == c.NicoId);

                    if (song == null) {
                        song = new Song(songContract);
                        session.Save(song);
                    }

                    poll.AddSong(song, songContract.SortIndex);
                    session.Save(poll);

                }
            });
        }