Example #1
0
        /// <summary>
        /// The <see cref="JobEntrypoint"/> for updating the repository.
        /// </summary>
        /// <param name="core">The <see cref="IInstanceCore"/> for the <paramref name="job"/>.</param>
        /// <param name="databaseContextFactory">The <see cref="IDatabaseContextFactory"/> for the <paramref name="job"/>.</param>
        /// <param name="job">The <see cref="Job"/> being run.</param>
        /// <param name="progressReporter">The progress reporter action for the <paramref name="job"/>.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
        /// <returns>A <see cref="Task"/> representing the running operation.</returns>
#pragma warning disable CA1502  // Cyclomatic complexity
        Task RepositoryAutoUpdateJob(
            IInstanceCore core,
            IDatabaseContextFactory databaseContextFactory,
            Job job,
            Action <int> progressReporter,
            CancellationToken cancellationToken)
        => databaseContextFactory.UseContext(
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InstanceWrapper"/> class.
 /// </summary>
 /// <param name="actualInstance">The value of <see cref="actualInstance"/>.</param>
 /// <param name="onDisposed">The value of <see cref="onDisposed"/>.</param>
 public InstanceWrapper(IInstanceCore actualInstance, Action onDisposed)
 {
     this.actualInstance = actualInstance ?? throw new ArgumentNullException(nameof(actualInstance));
     this.onDisposed     = onDisposed ?? throw new ArgumentNullException(nameof(onDisposed));
     Uid         = Guid.NewGuid();
     disposeLock = new object();
 }
Example #3
0
 /// <inheritdoc />
 public void Dispose()
 {
     lock (disposeLock)
     {
         onDisposed?.Invoke();
         onDisposed     = null;
         actualInstance = null;
     }
 }