blob: 0c2d0cfd17a1a6b46a608856c3826b11eb61d74b (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 | using Microsoft.Extensions.DependencyInjection;
using Timeline.Entities;
using Timeline.Models.Http;
namespace Timeline.Services.Mapper
{
    public static class MapperServiceCollectionExtensions
    {
        public static void AddMappers(this IServiceCollection services)
        {
            services.AddAutoMapper(typeof(Startup).Assembly);
            services.AddScoped<IMapper<UserEntity, HttpUser>, UserMapper>();
            services.AddScoped<IMapper<TimelineEntity, HttpTimeline>, TimelineMapper>();
            services.AddScoped<IMapper<TimelinePostEntity, HttpTimelinePost>, TimelineMapper>();
            services.AddScoped<IGenericMapper, GenericMapper>();
        }
    }
}
 |