Inheritance: IEntity, ICreatable, IModifiable
コード例 #1
0
        public void CreateNewSubscriptionForUserAndChannel(long userId, long channelId)
        {
            var channelTitle = this.database.RssChannels
                .Where(channel => channel.Id == channelId)
                .Select(channel => channel.Title)
                .Single();

            var rssChannelSubscription = new RssChannelSubscription(channelId, userId, channelTitle);
            this.database.RssChannelsSubscriptions.Add(rssChannelSubscription);
            this.database.SaveChanges();
        }
コード例 #2
0
 public void Subscribe(long idByChannelUrl, long currentUserId, string channelIdRssChannelName)
 {
     var rssChannelSubscription = new RssChannelSubscription(idByChannelUrl, currentUserId, channelIdRssChannelName);
     this.database.RssChannelsSubscriptions.Add(rssChannelSubscription);
     this.database.SaveChanges();
 }
コード例 #3
0
 public void Subscribe(long idByChannelUrl, long currentUserId)
 {
     var title = this.database.RssChannels.Single(x => x.Id == idByChannelUrl).Title;
     var rssChannelSubscription = new RssChannelSubscription(idByChannelUrl, currentUserId, title);
     this.database.RssChannelsSubscriptions.Add(rssChannelSubscription);
     this.database.SaveChanges();
 }