public static Integration Convert(AuthenticationRequestDocument doc)
 {
     return(new EastFive.Azure.Integration
     {
         integrationId = doc.Id,
         method = doc.Method,
         parameters = doc.GetExtraParams(),
         authorizationId = doc.LinkedAuthenticationId.GetValueOrDefault(),
     });
 }
 private static AuthenticationRequest Convert(Documents.AuthenticationRequestDocument document)
 {
     return(new AuthenticationRequest
     {
         id = document.Id,
         method = (CredentialValidationMethodTypes)Enum.Parse(typeof(CredentialValidationMethodTypes), document.Method, true),
         action = (AuthenticationActions)Enum.Parse(typeof(AuthenticationActions), document.Action, true),
         authorizationId = document.LinkedAuthenticationId,
         token = document.Token,
         extraParams = document.GetExtraParams(),
         redirect = document.RedirectUrl.IsNullOrWhiteSpace()?
                    default(Uri)
             :
                    new Uri(document.RedirectUrl),
         redirectLogout = document.RedirectLogoutUrl.IsNullOrWhiteSpace() ?
                          default(Uri)
             :
                          new Uri(document.RedirectLogoutUrl),
         Deleted = document.Deleted,
     });
 }