IdReference<TId>

Namespace: ASPSecurityKit.Authorization
Assembly: ASPSecurityKit.dll

Summary

Provides an implementation of the IIdReference model.

Generic Types
Name Description
TId Type of the entityId.

Constructors

#ctor(entityId)

Summary

Initializes a new instance of the IdReference<TId> class.

Parameters
Name Type Description
entityId `0 The entityId.

Properties

EntityId

Summary

Gets or sets the entity id.

Methods

GetEntityId()

Summary

Gets the reference value as entityId to authorize this reference.

Returns

The reference value as entityId to authorize this reference.

Parameters

This method has no parameters.

Remarks

Returns the EntityId by calling its ToString method.

GetPermissionCode(operationPermissionCode)

Summary

Gets the permission code to be used to authorize this reference. You should return the provided one as is if there’s no customization needed.

Returns

The permission code to be used to authorize this reference.

Parameters
Name Type Description
operationPermissionCode System.String The permission code that represents the current operation being executed.
Remarks

Returns the value of operationPermissionCode as is.

ToString()

Summary

Converts this instance to string.

Returns

A String that represents this instance.

Parameters

This method has no parameters.

Equals(obj)

Summary

Indicates whether this instance and a specified object are equal.

Returns

true if obj and this instance are the same type and represent the same value; otherwise, false.

Parameters
Name Type Description
obj System.Object The IdReference<TId> instance to compare with.
Remarks

See Equals for more details.

GetHashCode()

Summary

Returns a hash code for this instance.

Returns

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Parameters

This method has no parameters.

Remarks

The hash is obtained by calling the GetHashCode upon EntityId property.

Equals(other)

Summary

Indicates whether this instance and specified another instance are equal.

Returns

true if both instances are equal; otherwise, false.

Parameters
Name Type Description
other ASPSecurityKit.Authorization.IdReference{`0} The other instance to compare with.
Remarks

The equality is determined by calling Equals on EntityId property of this instance with the value of the same property of the other instance.