Esempio n. 1
0
        /// <summary>
        /// Run the given resolver to select a value from the json user data to add as a claim.
        /// This no-ops if the returned value is empty.
        /// </summary>
        /// <param name="collection">The <see cref="ClaimActionCollection"/>.</param>
        /// <param name="claimType">The value to use for Claim.Type when creating a Claim.</param>
        /// <param name="resolver">The Func that will be called to select value from the given json user data.</param>
        public static void MapCustomJson(this ClaimActionCollection collection, string claimType, Func <JsonElement, string?> resolver)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }

            collection.MapCustomJson(claimType, ClaimValueTypes.String, resolver);
        }
 /// <summary>
 /// Run the given resolver to select a value from the json user data to add as a claim.
 /// This no-ops if the returned value is empty.
 /// </summary>
 /// <param name="collection"></param>
 /// <param name="claimType">The value to use for Claim.Type when creating a Claim.</param>
 /// <param name="resolver">The Func that will be called to select value from the given json user data.</param>
 public static void MapCustomJson(this ClaimActionCollection collection, string claimType, Func <JsonElement, string> resolver)
 {
     collection.MapCustomJson(claimType, ClaimValueTypes.String, resolver);
 }