You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi.Mapping/AutoMapperProfile.cs

35 lines
933 B

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;
}
}
}