Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CosmosRepository" /> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="userConnectionInfo">The user connection information.</param>
 /// <param name="contactConnectionInfo">The contact connection information.</param>
 public CosmosRepository(
     IDocumentClient client,
     ICosmosConnectionInfo userConnectionInfo,
     ICosmosConnectionInfo contactConnectionInfo)
 {
     this.client                = client ?? throw new ArgumentNullException(nameof(client));
     this.userConnectionInfo    = userConnectionInfo ?? throw new ArgumentNullException(nameof(userConnectionInfo));
     this.contactConnectionInfo = contactConnectionInfo ?? throw new ArgumentNullException(nameof(contactConnectionInfo));
 }
Exemple #2
0
 /// <summary>
 /// Creates the document service.
 /// </summary>
 /// <param name="serviceResolver">The service resolver.</param>
 /// <param name="userConnectionInfo">The user connection information.</param>
 /// <param name="contactConnectionInfo">The contact connection information.</param>
 /// <param name="logService">The log service.</param>
 /// <returns>
 /// The <see cref="IContactService" />.
 /// </returns>
 public static IContactService CreateContactService(
     IServiceResolver serviceResolver,
     ICosmosConnectionInfo userConnectionInfo,
     ICosmosConnectionInfo contactConnectionInfo,
     ILogService logService)
 {
     return(new ContactService(
                CreateCosmosRepository(serviceResolver, userConnectionInfo, contactConnectionInfo),
                logService));
 }
Exemple #3
0
 /// <summary>
 /// Creates the cosmos failure repository.
 /// </summary>
 /// <param name="serviceResolver">The service resolver.</param>
 /// <param name="userConnectionInfo">The user connection information.</param>
 /// <param name="contactConnectionInfo">The contact connection information.</param>
 /// <returns>
 /// The <see cref="ICosmosConnectionInfo" />.
 /// </returns>
 public static ICosmosRepository CreateCosmosRepository(IServiceResolver serviceResolver, ICosmosConnectionInfo userConnectionInfo, ICosmosConnectionInfo contactConnectionInfo)
 {
     SetDocumentClient(serviceResolver, userConnectionInfo.EndpointUrl, userConnectionInfo.AuthKey); // same endpoint and auth key for both
     return(new CosmosRepository(
                serviceResolver.DocumentClient,
                userConnectionInfo,
                contactConnectionInfo));
 }