aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Services/Configurations/Mapping/UserMappings.cs
blob: 97355d688a57d896d9ec04e42fee179ccd409383 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using DevHive.Data.Models;
using AutoMapper;
using DevHive.Services.Models.Identity.User;

namespace DevHive.Services.Configurations.Mapping
{
	public class UserMappings : Profile
	{
		public UserMappings()
		{
			CreateMap<UserServiceModel, User>();
			CreateMap<RegisterServiceModel, User>();
			CreateMap<UpdateUserServiceModel, User>();
			CreateMap<UpdateUserCollectionServiceModel, User>()
				.ForMember(up => up.UserName, u => u.MapFrom(src => src.Name));


			CreateMap<User, UserServiceModel>();
		}
	}
}