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); } }
public void UnsubscribeCurrentUserFromChannelId(FeedsPostSubscription model) { var userId = this.infrastructure.GetCurrentUserId(); this.entityRepository.DeleteSubscriptionFromUser(model.FeedId, userId); }
public virtual ActionResult UnsubscribeFromChannel(FeedsPostSubscription input) { this.service.UnsubscribeCurrentUserFromChannelId(input); return new HttpStatusCodeResult(HttpStatusCode.OK); }
public virtual ActionResult SubscribeToChannel(FeedsPostSubscription input) { this.service.SubscribeCurrentUserToChannel(input); return new HttpStatusCodeResult(HttpStatusCode.OK); }