using Mapster; using Microsoft.Extensions.DependencyInjection; using DD.Persistence.Database.Model; using DD.Persistence.Models; using DD.Persistence.Repositories; using DD.Persistence.Repository.Repositories; using DD.Persistence.Database.Entity; namespace DD.Persistence.Repository; public static class DependencyInjection { public static void MapsterSetup() { TypeAdapterConfig.GlobalSettings.Default.Config .ForType() .Map(dest => dest.Value, src => new DataWithWellDepthAndSectionDto() { DepthEnd = src.DepthEnd, DepthStart = src.DepthStart, IdSection = src.IdSection, Value = src.Value, Id = src.Id }); TypeAdapterConfig.GlobalSettings.Default.Config .ForType() .Ignore(dest => dest.System, dest => dest.SystemId); } public static IServiceCollection AddInfrastructure(this IServiceCollection services) { MapsterSetup(); services.AddTransient, TimeSeriesDataRepository>(); services.AddTransient(); services.AddTransient, TimeSeriesDataCachedRepository>(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); return services; } }