/// <summary> /// Stores a new job request /// </summary> /// <param name="jobRequestModel">Job request to store</param> /// <param name="logger">Logger to log data</param> /// <returns></returns> public async Task <JobRequestModel> CreateAsync(JobRequestModel jobRequestModel, ILogger logger) { var message = JsonConvert.SerializeObject(jobRequestModel, this.settings); // Encode message to Base64 before sending to the queue await this.queue.SendMessageAsync(QueueServiceHelper.EncodeToBase64(message)).ConfigureAwait(false); logger.LogInformation($"JobRequestStorageService::CreateAsync successfully added request to the queue: jobRequestModel={LogHelper.FormatObjectForLog(jobRequestModel)}"); return(jobRequestModel); }
/// <summary> /// Stores provisioning completed event. /// </summary> /// <param name="provisioningCompletedEventModel">Event to store</param> /// <param name="logger">Logger to log data</param> /// <returns>Stored provisioning completed event</returns> public async Task <ProvisioningCompletedEventModel> CreateAsync(ProvisioningCompletedEventModel provisioningCompletedEventModel, ILogger logger) { var message = JsonConvert.SerializeObject(provisioningCompletedEventModel); // Encode message to Base64 before sending to the queue await this.queue.SendMessageAsync(QueueServiceHelper.EncodeToBase64(message)).ConfigureAwait(false); logger.LogInformation($"ProvisioningCompletedEventStorageService::CreateAsync successfully added request to the queue: provisioningCompletedEventModel={LogHelper.FormatObjectForLog(provisioningCompletedEventModel)}"); return(provisioningCompletedEventModel); }