mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 17:52:57 -07:00
35 lines
No EOL
933 B
C#
35 lines
No EOL
933 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using AutoMapper;
|
|
using AutoMapper.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Ombi.Mapping.Profiles;
|
|
|
|
namespace Ombi.Mapping
|
|
{
|
|
public static class AutoMapperProfile
|
|
{
|
|
public static IServiceCollection AddOmbiMappingProfile(this IServiceCollection services)
|
|
{
|
|
var profiles = new List<Profile>
|
|
{
|
|
new MovieProfile(),
|
|
new OmbiProfile(),
|
|
new SettingsProfile(),
|
|
new TvProfile(),
|
|
new TvProfileV2()
|
|
};
|
|
var config = new AutoMapper.MapperConfiguration(cfg =>
|
|
{
|
|
cfg.AddProfiles(profiles);
|
|
});
|
|
|
|
var mapper = config.CreateMapper();
|
|
services.AddSingleton(mapper);
|
|
|
|
return services;
|
|
}
|
|
}
|
|
} |