IdMemberReference<TIdReference>

Namespace: ASPSecurityKit.Authorization
Assembly: ASPSecurityKit.dll

Summary

Provides an implementation of the IIdMemberReference model.

Generic Types
Name Description
TIdReference The concrete type that implements IIdReference model.

Members

_valueString

Summary

The underlying value string field. For performance reason, you should write to it only once (if overriding) as Value is expected to be immutable.

Constructors

#ctor(memberName,value,parentName,references)

Summary

Initializes a new instance of the IdMemberReference<TIdReference> class.

Parameters
Name Type Description
memberName System.String The member name.
value System.Object The member value.
parentName System.String The name of the parent container object for this member. If provided, can be used for prefixing member name that has only ‘Id’ to locate the right related references provider.
references System.Collections.Generic.List{`0} | The related references. |

Properties

MemberName

Summary

Gets or sets the member name.

ParentName

Summary

Gets the name of the parent container object for this member. If provided, can be used for prefixing member name that has only ‘Id’ to locate the right related references provider.

Value

The name of the parent container object for this member.

AllNames

Summary

Gets all the names that this member can be referred by. It’ll be used to locate a related references loader (GetReferences). Usually it should return at least MemberName and combined ParentName with MemberName (if ParentName is non-empty).

Value

All the names that this member can be referred by.

Value

Summary

Gets or sets the member value.

ValueString

Summary

Gets the string representation of the member value.

Remarks

Calls to ToString on the Value to obtain the value. Feel free to override it if that’s not good enough for you.

References

Summary

Gets the references related to the entityId represented by this instance. It may include this instance entityId value as well. Serves the purpose of authorizing this entityId for the current operation.

ASPSecurityKit#Authorization#IIdMemberReference#References

Summary

Gets the references related to the entityId represented by this instance. It may include this instance entityId value as well. Serves the purpose of authorizing this entityId for the current operation.

Methods

AddReferences(idReferences)

Summary

Adds new items to the related references collection.

Parameters
Name Type Description
idReferences `0[] The related references to add.

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 IdMemberReference<TIdReference> 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 joining MemberName (lowercase using ToLowerInvariant ) and ValueString.

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.IdMemberReference{`0} The other instance to compare with.
Remarks

The equality is determined based on both MemberName (case-insensitive) and ValueString (case-sensitive).

ASPSecurityKit#Authorization#IIdMemberReference#AddReferences(idReferences)

Summary

Adds new items to the related references collection.

Parameters
Name Type Description
idReferences ASPSecurityKit.Authorization.IIdReference[] The related references to add.