using System.ComponentModel.DataAnnotations; using AutoMapper; namespace LeafWeb.Web.ViewModels.LeafInput { public class ConfirmViewModel { private static readonly IMapper Mapper; public string Name { get; set; } public string Email { get; set; } public string Identifier { get; set; } public string SiteId { get; set; } public string[] Files { get; set; } static ConfirmViewModel() { var config = new MapperConfiguration(cfg => { cfg.CreateMap(); }); Mapper = config.CreateMapper(); } public ConfirmViewModel(CreateViewModel createViewModel, string[] files) { Mapper.Map(createViewModel, this); Files = files; } } }