﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using UserList.Domain.Models;
using UserList.Models.Dto;

namespace UserList
{
    public class AutoMapperConfig
    {
        public static void AutoMapperRegister()
        {
            Mapper.Initialize(cfg =>
            {
                cfg.CreateMap<User, UserDto>();

                cfg.CreateMap<UserDto, User>()
                    .ForMember(dest => dest.Id, opt => opt.UseValue(Guid.Empty));
            });
            Mapper.AssertConfigurationIsValid();
        }
    }
}