Class ActivityService
A service allowing consumers to add and watch social activities in Episerver's Social Activity Streams system.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Social.ActivityStreams
Assembly: EPiServer.Social.ActivityStreams.dll
Version: 1.5.4Syntax
public class ActivityService : IActivityService
Methods
Add<TExtension>(Activity, TExtension)
Adds an activity with a payload of type TExtension to the activity queue.
As the activity is queued the calling thread is not blocked on processing of the activity,
which may be lengthy.
Declaration
public void Add<TExtension>(Activity activity, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Activity | activity | An activity sent to the ActivityStreams system |
| TExtension | extension | The activity payload supplied as an extension to the activity |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of the activity or payload |
Remarks
Note that this API is used to publish an activity to the Episerver Social Activity Streams system. Adding an activity is a non-blocking operation. Any activities published to the system by invoking this API are queued for processing, and control is immediately returned to the calling application. Any exceptions or errors encountered while processing an activity when it is dequeued at a later time are logged.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
Watch<TExtension>(IActivityHandler<TExtension>)
Watches an activity of type TExtension. The Activity Streams system will invoke the specified activity handler when an activity of type TExtension is received by the system.
Declaration
public void Watch<TExtension>(IActivityHandler<TExtension> activityTypeHandler)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| IActivityHandler<TExtension> | activityTypeHandler | The handler to call when the activity being watched is received by the Activity Streams system. |
Type Parameters
| Name | Description |
|---|---|
| TExtension | The activity serializable .NET type. |