using Mapster; using Microsoft.Extensions.DependencyInjection; using Persistence.Database.Model; using Persistence.Models; using Persistence.Repositories; using Persistence.Repository.Data; using Persistence.Repository.Repositories; namespace 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 }); } public static IServiceCollection AddInfrastructure(this IServiceCollection services) { MapsterSetup(); services.AddTransient, TimeSeriesDataRepository>(); services.AddTransient(); services.AddTransient, TimeSeriesDataCachedRepository>(); services.AddTransient(); services.AddTransient(); return services; } }