Skip to content

Commit 1908eab

Browse files
committed
add scope explicitly
1 parent 85024bb commit 1908eab

17 files changed

+49
-49
lines changed

src/MicroBatchFramework.WebHosting/BatchEngineMiddleware.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.AspNetCore.Http;
1+
using Microsoft.AspNetCore.Http;
22
using Microsoft.Extensions.Logging;
33
using System;
44
using System.Collections.Generic;
@@ -89,12 +89,12 @@ public override string ToString()
8989

9090
public class BatchEngineMiddleware
9191
{
92-
readonly RequestDelegate next;
93-
readonly IServiceProvider provider;
94-
readonly ILogger<BatchEngine> logger;
95-
readonly IBatchInterceptor interceptor;
92+
private readonly RequestDelegate next;
93+
private readonly IServiceProvider provider;
94+
private readonly ILogger<BatchEngine> logger;
95+
private readonly IBatchInterceptor interceptor;
9696

97-
readonly Dictionary<string, MethodInfo> methodLookup;
97+
private readonly Dictionary<string, MethodInfo> methodLookup;
9898

9999
public BatchEngineMiddleware(RequestDelegate next, ILogger<BatchEngine> logger, IBatchInterceptor interceptor, IServiceProvider provider, TargetBatchTypeCollection targetTypes)
100100
{

src/MicroBatchFramework.WebHosting/BatchEngineSwaggerMiddleware.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ namespace MicroBatchFramework.WebHosting
99
{
1010
public class BatchEngineSwaggerMiddleware
1111
{
12-
static readonly Task EmptyTask = Task.FromResult(0);
12+
private static readonly Task EmptyTask = Task.FromResult(0);
1313

14-
readonly RequestDelegate next;
15-
readonly MethodInfo[] handlers;
16-
readonly SwaggerOptions options;
14+
private readonly RequestDelegate next;
15+
private readonly MethodInfo[] handlers;
16+
private readonly SwaggerOptions options;
1717

1818
public BatchEngineSwaggerMiddleware(RequestDelegate next, TargetBatchTypeCollection targetTypes, SwaggerOptions options)
1919
{

src/MicroBatchFramework.WebHosting/Swagger/SwaggerDefinitionBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using MicroBatchFramework.WebHosting.Swagger.Schemas;
1+
using MicroBatchFramework.WebHosting.Swagger.Schemas;
22
using Microsoft.AspNetCore.Http;
33
using Newtonsoft.Json;
44
using Newtonsoft.Json.Serialization;
@@ -16,11 +16,11 @@ namespace MicroBatchFramework.WebHosting.Swagger
1616
{
1717
public class SwaggerDefinitionBuilder
1818
{
19-
readonly SwaggerOptions options;
20-
readonly HttpContext httpContext;
21-
readonly IEnumerable<MethodInfo> handlers;
19+
private readonly SwaggerOptions options;
20+
private readonly HttpContext httpContext;
21+
private readonly IEnumerable<MethodInfo> handlers;
2222

23-
ILookup<Tuple<string, string>, XmlCommentStructure> xDocLookup;
23+
private ILookup<Tuple<string, string>, XmlCommentStructure> xDocLookup;
2424

2525
public SwaggerDefinitionBuilder(SwaggerOptions options, HttpContext httpContext, IEnumerable<MethodInfo> handlers)
2626
{

src/MicroBatchFramework.WebHosting/Swagger/SwaggerOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace MicroBatchFramework.WebHosting.Swagger
66
{
77
public class SwaggerOptions
88
{
9-
public string ApiBasePath { get; private set; }
9+
public string ApiBasePath { get; }
1010
public Info Info { get; set; }
1111

1212
/// <summary>

src/MicroBatchFramework.WebHosting/TargetBatchTypeCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace MicroBatchFramework.WebHosting
66
{
77
public class TargetBatchTypeCollection : IEnumerable<Type>
88
{
9-
readonly IEnumerable<Type> types;
9+
private readonly IEnumerable<Type> types;
1010

1111
public TargetBatchTypeCollection(IEnumerable<Type> types)
1212
{

src/MicroBatchFramework/BatchContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace MicroBatchFramework
66
{
77
public class BatchContext
88
{
9-
public string[] Arguments { get; private set; }
10-
public DateTime Timestamp { get; private set; }
11-
public CancellationToken CancellationToken { get; private set; }
12-
public ILogger<BatchEngine> Logger { get; private set; }
9+
public string[] Arguments { get; }
10+
public DateTime Timestamp { get; }
11+
public CancellationToken CancellationToken { get; }
12+
public ILogger<BatchEngine> Logger { get; }
1313

1414
public BatchContext(string[] arguments, DateTime timestamp, CancellationToken cancellationToken, ILogger<BatchEngine> logger)
1515
{

src/MicroBatchFramework/BatchEngine.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Extensions.Logging;
1+
using Microsoft.Extensions.Logging;
22
using System;
33
using System.Collections.Generic;
44
using System.Collections.ObjectModel;
@@ -13,10 +13,10 @@ namespace MicroBatchFramework
1313
{
1414
public class BatchEngine
1515
{
16-
readonly ILogger<BatchEngine> logger;
17-
readonly IServiceProvider provider;
18-
readonly IBatchInterceptor interceptor;
19-
readonly CancellationToken cancellationToken;
16+
private readonly ILogger<BatchEngine> logger;
17+
private readonly IServiceProvider provider;
18+
private readonly IBatchInterceptor interceptor;
19+
private readonly CancellationToken cancellationToken;
2020

2121
public BatchEngine(ILogger<BatchEngine> logger, IServiceProvider provider, IBatchInterceptor interceptor, CancellationToken cancellationToken)
2222
{

src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace MicroBatchFramework
1010
{
1111
public static class BatchEngineHostBuilderExtensions
1212
{
13-
const string ListCommand = "list";
14-
const string HelpCommand = "help";
13+
private const string ListCommand = "list";
14+
private const string HelpCommand = "help";
1515

1616
public static IHostBuilder UseBatchEngine(this IHostBuilder hostBuilder, string[] args, IBatchInterceptor interceptor = null)
1717
{
@@ -153,7 +153,7 @@ public static Task RunBatchEngineAsync<T>(this IHostBuilder hostBuilder, string[
153153
return UseBatchEngine<T>(hostBuilder, args, interceptor).Build().RunAsync();
154154
}
155155

156-
static void ShowMethodList()
156+
private static void ShowMethodList()
157157
{
158158
Console.WriteLine("list of methods:");
159159
var list = GetBatchTypes();
@@ -166,7 +166,7 @@ static void ShowMethodList()
166166
}
167167
}
168168

169-
static List<Type> GetBatchTypes()
169+
private static List<Type> GetBatchTypes()
170170
{
171171
List<Type> batchBaseTypes = new List<Type>();
172172

@@ -196,7 +196,7 @@ static List<Type> GetBatchTypes()
196196
return batchBaseTypes;
197197
}
198198

199-
static (Type, MethodInfo) GetTypeFromAssemblies(string arg0)
199+
private static (Type, MethodInfo) GetTypeFromAssemblies(string arg0)
200200
{
201201
var batchBaseTypes = GetBatchTypes();
202202
if (batchBaseTypes == null)

src/MicroBatchFramework/BatchEngineService.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ namespace MicroBatchFramework
99
{
1010
public sealed class BatchEngineService : IHostedService
1111
{
12-
string[] args;
13-
Type type;
14-
MethodInfo methodInfo;
15-
IApplicationLifetime appLifetime;
16-
ILogger<BatchEngine> logger;
17-
IServiceProvider provider;
18-
IBatchInterceptor interceptor;
19-
Task runningTask;
20-
CancellationTokenSource cancellationTokenSource;
12+
private readonly string[] args;
13+
private readonly Type type;
14+
private readonly MethodInfo methodInfo;
15+
private readonly IApplicationLifetime appLifetime;
16+
private readonly ILogger<BatchEngine> logger;
17+
private readonly IServiceProvider provider;
18+
private readonly IBatchInterceptor interceptor;
19+
private Task runningTask;
20+
private readonly CancellationTokenSource cancellationTokenSource;
2121

2222
public BatchEngineService(IApplicationLifetime appLifetime, Type type, string[] args, ILogger<BatchEngine> logger, IServiceProvider provider)
2323
: this(appLifetime, type, null, args, logger, provider)

src/MicroBatchFramework/CompositeBatchInterceptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace MicroBatchFramework
99
{
1010
public class CompositeBatchInterceptor : IBatchInterceptor
1111
{
12-
readonly IBatchInterceptor[] interceptors;
12+
private readonly IBatchInterceptor[] interceptors;
1313

1414
public CompositeBatchInterceptor(params IBatchInterceptor[] interceptors)
1515
{
@@ -87,7 +87,7 @@ public async ValueTask OnBatchRunCompleteAsync(BatchContext context, string erro
8787

8888
internal struct AggregateExceptionHolder
8989
{
90-
List<ExceptionDispatchInfo> exceptions;
90+
private List<ExceptionDispatchInfo> exceptions;
9191

9292
public void Add(Exception ex)
9393
{

0 commit comments

Comments
 (0)