Class SubscriptionController
This controller is responsible to manage the user subscriptions.
Inheritance
Implements
Inherited Members
Namespace: DotNetNuke.Services.Social.Subscriptions
Assembly: DotNetNuke.dll
Syntax
public class SubscriptionController : ServiceLocator<ISubscriptionController, SubscriptionController>, ISubscriptionController
Constructors
| Improve this Doc View SourceSubscriptionController()
Initializes a new instance of the SubscriptionController class.
Declaration
public SubscriptionController()
Methods
| Improve this Doc View SourceAddSubscription(Subscription)
Adds a new Subscription. If the operation succeed the SubscriptionId property of the Subscription entity will be filled up.
Declaration
public void AddSubscription(Subscription subscription)
Parameters
Type | Name | Description |
---|---|---|
Subscription | subscription | Subscription. |
DeleteSubscription(Subscription)
Deletes a Subscription.
Declaration
public void DeleteSubscription(Subscription subscription)
Parameters
Type | Name | Description |
---|---|---|
Subscription | subscription | Subscription. |
DeleteSubscriptionsByObjectKey(Int32, String)
Deletes all subscriptions matching the specified object key.
Declaration
public void DeleteSubscriptionsByObjectKey(int portalId, string objectKey)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Portal Id. |
System.String | objectKey | Object Key. |
GetContentSubscriptions(Int32, Int32, String)
Returns the Content Subscriptions.
Declaration
public IEnumerable<Subscription> GetContentSubscriptions(int portalId, int subscriptionTypeId, string objectKey)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Portal Id. |
System.Int32 | subscriptionTypeId | Subscription Type Id. |
System.String | objectKey | Object Key. |
Returns
Type | Description |
---|---|
IEnumerable<Subscription> | Collection of subscriptions. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<ISubscriptionController> GetFactory()
Returns
Type | Description |
---|---|
Func<ISubscriptionController> | A factory function. |
Overrides
GetUserSubscriptions(UserInfo, Int32, Int32)
Returns the User Subscriptions.
Declaration
public IEnumerable<Subscription> GetUserSubscriptions(UserInfo user, int portalId, int subscriptionTypeId = null)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | User Info. |
System.Int32 | portalId | Portal Id. |
System.Int32 | subscriptionTypeId | Subscription Type Id. |
Returns
Type | Description |
---|---|
IEnumerable<Subscription> | Collection of subscriptions. |
IsSubscribed(Subscription)
Returns true if a user is subscribed to a Content.
Declaration
public bool IsSubscribed(Subscription subscription)
Parameters
Type | Name | Description |
---|---|---|
Subscription | subscription | Subscription. |
Returns
Type | Description |
---|---|
System.Boolean | True if the user is subscribed to the content, false otherwise. |
UpdateSubscriptionDescription(String, Int32, String)
Updates a Subscription Description.
Declaration
public int UpdateSubscriptionDescription(string objectKey, int portalId, string newDescription)
Parameters
Type | Name | Description |
---|---|---|
System.String | objectKey | Subscription Object Key. |
System.Int32 | portalId | Portal Id. |
System.String | newDescription | New Subscription Description. |
Returns
Type | Description |
---|---|
System.Int32 | The number of subscription descriptions that have been updated. |