CompareCloudware.Web/FluentSecurity/Extensions.cs
/// <summary>
/// Returns true if the policy is of the expected type. Takes care of checking for lazy policies.
/// </summary>
/// <param name="securityPolicy">The policy</param>
/// <returns>A boolean</returns>
Returns true if the policy is of the expected type. Takes care of checking for lazy policies.
Returns true if the policy is of the expected type . Takes care of checking for lazy policies .
internal static bool IsPolicyOf<TSecurityPolicy>(this ISecurityPolicy securityPolicy) where TSecurityPolicy : class, ISecurityPolicy
        {
            var isMatch = securityPolicy is TSecurityPolicy;
            if (!isMatch) isMatch = securityPolicy.GetPolicyType() == typeof(TSecurityPolicy);
            return isMatch;
        }
internal static bool IsPolicyOf < TSecurityPolicy > ( this ISecurityPolicy securityPolicy ) where TSecurityPolicy : class , ISecurityPolicy { var isMatch = securityPolicy is TSecurityPolicy ; if ( ! isMatch ) isMatch = securityPolicy . GetPolicyType ( ) == typeof ( TSecurityPolicy ) ; return isMatch ; }
Returns true if the policy is of the expected type.
Returns true if the policy is of the expected type .
None
ISecurityPolicy
this
securityPolicy
None