40 lines
		
	
	
		
			937 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			937 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Diagnostics;
 | |
| using GerstITS.Examples.Logic.Example;
 | |
| using GerstITS.IoC;
 | |
| using GerstITS.System.Json;
 | |
| 
 | |
| namespace GerstITS.Examples.Api.StartupTasks
 | |
| {
 | |
|     internal class ExampleStartupTask : IStartupTask
 | |
|     {
 | |
|         #region Fields#
 | |
| 
 | |
|         private readonly IExampleProvider _provider;
 | |
|         private readonly IJsonConvert _jsonConvert;
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region Construtcors
 | |
| 
 | |
|         public ExampleStartupTask(IExampleProvider provider,
 | |
|                                   IJsonConvert jsonConvert)
 | |
|         {
 | |
|             _jsonConvert = jsonConvert;
 | |
|             _provider = provider;
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region IStartupTask
 | |
| 
 | |
|         public StartupPriorities Priority => StartupPriorities.Normal;
 | |
| 
 | |
|         public void Execute()
 | |
|         {
 | |
|             Debug.WriteLine($"---> {nameof(ExampleStartupTask)}: {_jsonConvert.Serialize(_provider.GetById(123))}");
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
|     }
 | |
| }
 |