/
MigrationServiceFactory.cs
49 lines (43 loc) · 1.79 KB
/
MigrationServiceFactory.cs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using Yuniql.Extensibility;
namespace Yuniql.Core
{
/// <summary>
/// Factory class of creating instance of <see cref="IMigrationService"/>.
/// </summary>
public class MigrationServiceFactory : IMigrationServiceFactory
{
private readonly ITraceService _traceService;
///<inheritdoc/>
public MigrationServiceFactory(
ITraceService traceService)
{
this._traceService = traceService;
}
///<inheritdoc/>
public IMigrationService Create(IDataService dataService, IBulkImportService bulkImportService)
{
return CreateInternal(dataService, bulkImportService);
}
private IMigrationService CreateInternal(IDataService dataService, IBulkImportService bulkImportService)
{
var directoryService = new DirectoryService(_traceService);
var fileService = new FileService();
var workspaceService = new WorkspaceService(_traceService, directoryService, fileService);
var tokenReplacementService = new TokenReplacementService(_traceService);
var metadataService = new MetadataService(dataService, _traceService, tokenReplacementService);
var environmentService = new EnvironmentService();
var configurationService = new ConfigurationService(environmentService, workspaceService, _traceService);
var migrationService = new MigrationService(
workspaceService,
dataService,
bulkImportService,
metadataService,
tokenReplacementService,
directoryService,
fileService,
_traceService,
configurationService);
return migrationService;
}
}
}