-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathArcGISConverterModule.cs
39 lines (34 loc) · 1.55 KB
/
ArcGISConverterModule.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
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Converters.ArcGIS3.ToSpeckle.Helpers;
using Speckle.Converters.ArcGIS3.Utils;
using Speckle.Converters.Common;
using Speckle.Converters.Common.Registration;
using Speckle.Sdk;
namespace Speckle.Converters.ArcGIS3;
public static class ArcGISConverterModule
{
public static void AddArcGISConverters(this IServiceCollection serviceCollection)
{
var converterAssembly = Assembly.GetExecutingAssembly();
//register types by default
serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly);
// add single root converter
//don't need a host specific RootToSpeckleConverter
serviceCollection.AddRootCommon<RootToSpeckleConverter>(converterAssembly);
// add application converters
serviceCollection.AddApplicationConverters<ArcGISToSpeckleUnitConverter, ACG.Unit>(converterAssembly);
// most things should be InstancePerLifetimeScope so we get one per operation
serviceCollection.AddScoped<IFeatureClassUtils, FeatureClassUtils>();
serviceCollection.AddScoped<IArcGISFieldUtils, ArcGISFieldUtils>();
serviceCollection.AddScoped<LocalToGlobalConverterUtils>();
serviceCollection.AddScoped<ICharacterCleaner, CharacterCleaner>();
serviceCollection.AddScoped<DisplayValueExtractor>();
serviceCollection.AddScoped<PropertiesExtractor>();
// single stack per conversion
serviceCollection.AddScoped<
IConverterSettingsStore<ArcGISConversionSettings>,
ConverterSettingsStore<ArcGISConversionSettings>
>();
}
}