using AutoMapper;
using Qusion.Cms.Modules.Polls.Core;
using Qusion.Cms.Modules.Polls.Domain;
using Qusion.Cms.Modules.Polls.Queries;


namespace Qusion.WebApp.Areas.Qusion.Models.Polls
{
    public class PollAnswerProfile : Profile
    {
        private readonly PollService _pollService;

        public PollAnswerProfile( PollService pollService)
        {
            _pollService = pollService;
        }

        protected override void Configure()
        {
            Mapper.CreateMap<PollAnswer, PollAnswerModel>();
            Mapper.CreateMap<PollAnswer, PollAnswerListModel>()
             .ForMember(x => x.QuestionID, o => o.MapFrom(x => x.Question.ID));

            Mapper.CreateMap<PollAnswerCreateModel, PollAnswer>();

            Mapper.CreateMap<PollAnswer, PollAnswerEditModel>();

            Mapper.CreateMap<PollAnswerEditModel, PollAnswer>();

            Mapper.CreateMap<PollAnswerQuery, PollQuery>()
                .ConstructUsing(x => PollQuery.Default);

           
        }
    }
}