Class AssertParams
Asserts parameter values for the different rating functions. An exception is thrown if the criteria data is found to be insufficient.
Inheritance
Inherited Members
Namespace: EPiServer.Social.Ratings.Core
Assembly: EPiServer.Social.Ratings.Core.dll
Version: 1.5.4Syntax
public static class AssertParams
Methods
ForAdd(Rating)
Assert values for adding a Rating
Declaration
public static void ForAdd(Rating rating)
Parameters
| Type | Name | Description |
|---|---|---|
| Rating | rating | The Rating object to assert. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified rating data is insufficient. |
| System.ArgumentNullException | The specified rating data is insufficient. |
ForAdd<TExtension>(Rating, TExtension)
Assert values for adding a Rating with extension metadata
Declaration
public static void ForAdd<TExtension>(Rating rating, TExtension extension)
Parameters
| Type | Name | Description |
|---|---|---|
| Rating | rating | The Rating object to assert. |
| TExtension | extension | The Rating extension metadata. |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified rating data is insufficient. |
| System.ArgumentNullException | The specified rating data is insufficient. |
ForGet(Criteria<RatingFilter>)
Assert values for getting a Rating with criteria.
Declaration
public static void ForGet(Criteria<RatingFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<RatingFilter> | criteria | The Rating filter criteria. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | The specified rating criteria is insufficient. |
| InvalidPageInfoException | The specified rating data paging info is insufficient. |
ForGet(Criteria<RatingStatisticsFilter>)
Assert values for getting rating statistics with criteria.
Declaration
public static void ForGet(Criteria<RatingStatisticsFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<RatingStatisticsFilter> | criteria | The Rating Statistics filter criteria. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | The specified rating statistics criteria is insufficient. |
| InvalidPageInfoException | The specified rating statistics data paging info is insufficient. |
ForGet(RatingId)
Assert values for getting a rating based on its identifier.
Declaration
public static void ForGet(RatingId id)
Parameters
| Type | Name | Description |
|---|---|---|
| RatingId | id | Identifier of the rating to get. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified rating data is insufficient. |
ForRemove(RatingId)
Assert values for deleting a Rating
Declaration
public static void ForRemove(RatingId id)
Parameters
| Type | Name | Description |
|---|---|---|
| RatingId | id | The RatingId object to assert. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified rating data is insufficient. |
| System.ArgumentNullException | The specified rating data is insufficient. |
ForUpdate(RatingId, RatingValue, RatingValue)
Assert values for updating a Rating
Declaration
public static void ForUpdate(RatingId id, RatingValue oldValue, RatingValue newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| RatingId | id | Identifier of the rating to update. |
| RatingValue | oldValue | The old rating value that was part of the existing rating. |
| RatingValue | newValue | The newV rating value to set in the rating. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified rating data is insufficient. |
| System.ArgumentNullException | The specified rating data is insufficient. |
ForUpdate<TExtension>(Reference, TExtension)
Assert values for updating a rating statistics extension data.
Declaration
public static void ForUpdate<TExtension>(Reference target, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Reference | target | The rating statistics target to assert. |
| TExtension | extension | The rating statistics extension data to assert. |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified statistics data is insufficient. |
| System.ArgumentNullException | The specified statistics data is insufficient. |
ForUpdate<TExtension>(RatingId, RatingValue, RatingValue, TExtension)
Assert values for updating a Rating with extension metadata
Declaration
public static void ForUpdate<TExtension>(RatingId id, RatingValue oldValue, RatingValue newValue, TExtension extension)
Parameters
| Type | Name | Description |
|---|---|---|
| RatingId | id | Identifier of the rating to update. |
| RatingValue | oldValue | The old rating value that was part of the existing rating. |
| RatingValue | newValue | The newV rating value to set in the rating. |
| TExtension | extension | The Rating extension metadata. |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | The specified rating data is insufficient. |
| System.ArgumentNullException | The specified rating data is insufficient. |