Use file scoped namepace
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
using GerstITS.Job.Scheduling;
|
||||
|
||||
namespace GerstITS.Examples.Jobs.SayHelloWorld.Configurations
|
||||
{
|
||||
public class SayHelloWorldJobConfiguration : JobSchedulingConfigurationBase
|
||||
{
|
||||
#region Constructors
|
||||
namespace GerstITS.Examples.Jobs.SayHelloWorld.Configurations;
|
||||
|
||||
public SayHelloWorldJobConfiguration(Microsoft.Extensions.Configuration.IConfiguration configuration)
|
||||
: base(configuration)
|
||||
{
|
||||
}
|
||||
public class SayHelloWorldJobConfiguration : JobSchedulingConfigurationBase
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public SayHelloWorldJobConfiguration(Microsoft.Extensions.Configuration.IConfiguration configuration)
|
||||
: base(configuration)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -6,40 +6,39 @@ using GerstITS.Job;
|
||||
using GerstITS.System.Environment;
|
||||
using Quartz;
|
||||
|
||||
namespace GerstITS.Examples.Jobs.SayHelloWorld.Jobs
|
||||
namespace GerstITS.Examples.Jobs.SayHelloWorld.Jobs;
|
||||
|
||||
[DisallowConcurrentExecution]
|
||||
public class SayHelloWorldJob : JobBase
|
||||
{
|
||||
[DisallowConcurrentExecution]
|
||||
public class SayHelloWorldJob : JobBase
|
||||
#region Fields
|
||||
|
||||
private readonly SayHelloWorldJobConfiguration _configuration;
|
||||
private readonly Stopwatch _stopWatch;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cosntructors
|
||||
|
||||
public SayHelloWorldJob(SayHelloWorldJobConfiguration configuration,
|
||||
ISystemClock systemClock)
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly SayHelloWorldJobConfiguration _configuration;
|
||||
private readonly Stopwatch _stopWatch;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cosntructors
|
||||
|
||||
public SayHelloWorldJob(SayHelloWorldJobConfiguration configuration,
|
||||
ISystemClock systemClock)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_stopWatch = new Stopwatch();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void Execute()
|
||||
{
|
||||
_stopWatch.Restart();
|
||||
Thread.Sleep(4000);
|
||||
|
||||
_stopWatch.Stop();
|
||||
Debug.WriteLine($"---> Say hello to world from {_configuration.Name}, Duration: {_stopWatch.ElapsedMilliseconds / 1000}s");
|
||||
}
|
||||
|
||||
#endregion
|
||||
_configuration = configuration;
|
||||
_stopWatch = new Stopwatch();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected override void Execute()
|
||||
{
|
||||
_stopWatch.Restart();
|
||||
Thread.Sleep(4000);
|
||||
|
||||
_stopWatch.Stop();
|
||||
Debug.WriteLine($"---> Say hello to world from {_configuration.Name}, Duration: {_stopWatch.ElapsedMilliseconds / 1000}s");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -4,17 +4,16 @@ using GerstITS.IoC;
|
||||
using GerstITS.Job.Scheduling;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace GerstITS.Examples.Jobs.SayHelloWorld
|
||||
{
|
||||
public sealed class Module : IIoCModule<IServiceCollection>
|
||||
{
|
||||
#region IIoCModule
|
||||
namespace GerstITS.Examples.Jobs.SayHelloWorld;
|
||||
|
||||
public void RegisterComponents(IServiceCollection container)
|
||||
{
|
||||
container.RegisterJob<SayHelloWorldJob, SayHelloWorldJobConfiguration>();
|
||||
}
|
||||
public sealed class Module : IIoCModule<IServiceCollection>
|
||||
{
|
||||
#region IIoCModule
|
||||
|
||||
public void RegisterComponents(IServiceCollection container)
|
||||
{
|
||||
container.RegisterJob<SayHelloWorldJob, SayHelloWorldJobConfiguration>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user