using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper.SourceModel;
using AutoMapper.TargetModel;

namespace AutoMapper.Profiles
{
    public class OsobaProfile : Profile
    {
        public override string ProfileName
        {
            get { return "OsobaProfile"; }
        }

        protected override void Configure()
        {
            Mapper.CreateMap<Osoba, OsobaListaDto>()
                .ForMember(dest => dest.Age, opt => opt.MapFrom(e => DateTime.Now.Year - e.BirthDate.Year));
        }
    }
}
