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

namespace DevHive.Services.Configurations.Mapping
{
	public class RatingMappings : Profile
	{
		public RatingMappings()
		{
			CreateMap<CreateRatingServiceModel, Rating>()
				.ForMember(dest => dest.User, src => src.Ignore())
				.ForMember(dest => dest.Post, src => src.Ignore())
				.ForMember(dest => dest.Id, src => src.Ignore());

			CreateMap<Rating, ReadRatingServiceModel>();

			CreateMap<UpdateRatingServiceModel, Rating>();
		}
	}
}