Files
speckle-sharp-connectors/Converters/Autocad/Speckle.Converters.AutocadShared/ServiceRegistration.cs
T
Dogukan Karatas 034e1dcef8 feat (civil3d): data object with raw encoding for solid3d objects (#1208)
* solidx converter added

* some formatting

* version bump

* supress the check

* dwg based dataobject

* replace dwg with sat

* update sdk package

* some cleanup

* change operation order

* some formatting

* ITypedConverter cast

* static to ITypedConverter

* minors

* non-nullable parameters

* unit conversion added

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-12-08 21:28:50 +03:00

37 lines
1.4 KiB
C#

using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Converters.Autocad.ToHost.Helpers;
using Speckle.Converters.AutocadShared.ToSpeckle;
using Speckle.Converters.Common;
using Speckle.Converters.Common.Registration;
using Speckle.Sdk;
namespace Speckle.Converters.Autocad;
public static class ServiceRegistration
{
public static void AddAutocadConverters(this IServiceCollection serviceCollection)
{
var converterAssembly = Assembly.GetExecutingAssembly();
//register types by default
serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly);
// add single root converter
serviceCollection.AddRootCommon<AutocadRootToSpeckleConverter>(converterAssembly);
// add application converters and context stack
serviceCollection.AddApplicationConverters<AutocadToSpeckleUnitConverter, ADB.UnitsValue>(converterAssembly);
serviceCollection.AddScoped<
IConverterSettingsStore<AutocadConversionSettings>,
ConverterSettingsStore<AutocadConversionSettings>
>();
serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetExecutingAssembly());
// add other classes
serviceCollection.AddScoped<PropertiesExtractor>();
serviceCollection.AddScoped<IPropertiesExtractor, PropertiesExtractor>();
serviceCollection.AddScoped<ExtensionDictionaryExtractor>();
serviceCollection.AddScoped<XDataExtractor>();
serviceCollection.AddScoped<EntityUnitConverter>();
}
}