using AutoMapper;
using Qusion.Cms.Core.Domain;
using Qusion.Cms.Media;
using Qusion.Framework;

namespace Qusion.WebApp.Areas.Qusion.Models.Libraries
{
    public class LibraryProfile : Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<Library, LibraryListModel>();

            CreateMap<LibraryCreateInput, Library>();

            CreateMap<LibraryEditInput, Library>();

            Mapper.CreateMap<Library, LibraryModel>();


            Mapper.CreateMap<Library, LibraryModel>()
               .ForMember(x => x.Radnici, o => o.MapFrom(x => x.Radnici.Split(',')));
        }
    }
}