Exemple #1
0
 /// <summary>
 /// Deep clone
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static AuthenticationMethodModel Clone(this AuthenticationMethodModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new AuthenticationMethodModel {
         Configuration = model.Configuration.DeepClone(),
         Id = model.Id,
         SecurityPolicy = model.SecurityPolicy,
         CredentialType = model.CredentialType
     });
 }
Exemple #2
0
 /// <summary>
 /// Equality comparison
 /// </summary>
 /// <param name="model"></param>
 /// <param name="that"></param>
 /// <returns></returns>
 public static bool IsSameAs(this AuthenticationMethodModel model,
                             AuthenticationMethodModel that)
 {
     if (model == that)
     {
         return(true);
     }
     if (model == null || that == null)
     {
         return(false);
     }
     if (model.Configuration != null && that.Configuration != null)
     {
         if (!JToken.DeepEquals(model.Configuration, that.Configuration))
         {
             return(false);
         }
     }
     return
         (model.Id == that.Id &&
          model.SecurityPolicy == that.SecurityPolicy &&
          (that.CredentialType ?? CredentialType.None) ==
          (model.CredentialType ?? CredentialType.None));
 }