-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathIStartupServiceToRunSequentially.cs
More file actions
32 lines (29 loc) · 1.42 KB
/
Copy pathIStartupServiceToRunSequentially.cs
File metadata and controls
32 lines (29 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2021 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
// Licensed under MIT license. See License.txt in the project root for license information.
using System;
using System.Threading.Tasks;
namespace RunMethodsSequentially
{
/// <summary>
/// This defines the service that you want run within a locked state
/// </summary>
public interface IStartupServiceToRunSequentially
{
/// <summary>
/// This defines the order in which your startup services are run.
/// Note that startup services with the same <see cref="OrderNum"/> will
/// be run in the order that they were registered with the <see cref="StartupExtensions.RegisterServiceToRunInJob"/>
/// </summary>
public int OrderNum { get; }
/// <summary>
/// This method will be called within the RunMethodsSequentially JobRunner
/// </summary>
/// <param name="scopedServices">The RunMethodsSequentially JobRunner will provide a scoped service provider,
/// which allows you to obtain services more efficiently, but be aware the scoped service is used by every
/// startup services you register. But be aware that sharing the scoped service this might cause issues
/// whn using EF Core if
/// </param>
/// <returns></returns>
ValueTask ApplyYourChangeAsync(IServiceProvider scopedServices);
}
}