Moved projects to their own separate subdirectories
This commit is contained in:
22
API/YABA.Service/Configuration/AutoMapperProfile.cs
Normal file
22
API/YABA.Service/Configuration/AutoMapperProfile.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using AutoMapper;
|
||||
using YABA.Common.DTOs;
|
||||
using YABA.Common.DTOs.Bookmarks;
|
||||
using YABA.Common.DTOs.Tags;
|
||||
using YABA.Models;
|
||||
|
||||
namespace YABA.Service.Configuration
|
||||
{
|
||||
public class AutoMapperProfile : Profile
|
||||
{
|
||||
public AutoMapperProfile()
|
||||
{
|
||||
CreateMap<User, UserDTO>();
|
||||
CreateMap<BookmarkDTO, Bookmark>();
|
||||
CreateMap<Bookmark, BookmarkDTO>();
|
||||
CreateMap<CreateBookmarkRequestDTO, Bookmark>();
|
||||
CreateMap<Tag, TagDTO>();
|
||||
CreateMap<CreateTagDTO, Tag>()
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name.ToLowerInvariant()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YABA.Service.Interfaces;
|
||||
|
||||
namespace YABA.Service.Configuration
|
||||
{
|
||||
public static class DependencyInjectionConfiguration
|
||||
{
|
||||
public static void AddServiceProjectDependencyInjectionConfiguration(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddScoped<IUserService, UserService>();
|
||||
services.AddScoped<IBookmarkService, BookmarkService>();
|
||||
services.AddScoped<IMiscService, MiscService>();
|
||||
services.AddScoped<ITagsService, TagsService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user