using AutoMapper;
using NewsletterSender.WebApplication.DTO;
using NewsletterSender.WebApplication.Models;

namespace NewsletterSender.WebApplication.Configuration.Mapper.Converters
{
    public class LinkCategoryToLinkCategoryDtoConverter : ITypeConverter<LinkCategory, LinkCategoryDto>
    {
        public LinkCategoryDto Convert(LinkCategory source, LinkCategoryDto destination, ResolutionContext context)
        {
            destination = new LinkCategoryDto();
            destination.Id = source.Id;
            destination.CreationDate = source.CreationDate;
            destination.LastModificationDate = source.LastModificationDate;
            destination.IsDeleted = source.IsDeleted;
            destination.Name = source.Name;
            destination.Description = source.Description;
            destination.OrderIndex = source.OrderIndex;
            return destination;
        }
    }
}