示例#1
0
        public void SubscribeCurrentUserToChannel(FeedsPostSubscription model)
        {
            var currentUserId = this.infrastructure.GetCurrentUserId();
            var isUserSubscribedToChannelUrl =
                this.entityRepository.IsUserSubscribedToChannelId(currentUserId, model.FeedId);

            if (!isUserSubscribedToChannelUrl)
            {
                this.entityRepository.Subscribe(model.FeedId, currentUserId);
            }
        }
示例#2
0
        public void UnsubscribeCurrentUserFromChannelId(FeedsPostSubscription model)
        {
            var userId = this.infrastructure.GetCurrentUserId();

            this.entityRepository.DeleteSubscriptionFromUser(model.FeedId, userId);
        }
示例#3
0
 public virtual ActionResult UnsubscribeFromChannel(FeedsPostSubscription input)
 {
     this.service.UnsubscribeCurrentUserFromChannelId(input);
     return new HttpStatusCodeResult(HttpStatusCode.OK);
 }
示例#4
0
 public virtual ActionResult SubscribeToChannel(FeedsPostSubscription input)
 {
     this.service.SubscribeCurrentUserToChannel(input);
     return new HttpStatusCodeResult(HttpStatusCode.OK);
 }