Add WebCms
This commit is contained in:
@@ -5,8 +5,6 @@ namespace LeafWeb.Web.ViewModels.LeafInput
|
||||
{
|
||||
public class ConfirmViewModel
|
||||
{
|
||||
private static readonly IMapper Mapper;
|
||||
|
||||
[Display(Name = "Your name")]
|
||||
public string Name { get; set; }
|
||||
[Display(Name = "Your email")]
|
||||
@@ -21,12 +19,7 @@ namespace LeafWeb.Web.ViewModels.LeafInput
|
||||
|
||||
static ConfirmViewModel()
|
||||
{
|
||||
var config =
|
||||
new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<CreateViewModel, ConfirmViewModel>();
|
||||
});
|
||||
Mapper = config.CreateMapper();
|
||||
Mapper.CreateMap<CreateViewModel, ConfirmViewModel>();
|
||||
}
|
||||
|
||||
public ConfirmViewModel(CreateViewModel createViewModel, string[] files)
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace LeafWeb.Web.ViewModels.LeafInput
|
||||
{
|
||||
public class CreateViewModel
|
||||
{
|
||||
private static readonly IMapper Mapper;
|
||||
|
||||
[Display(Name = "Your name")]
|
||||
[Required(ErrorMessage = "Name required")]
|
||||
[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please provide your full name")]
|
||||
@@ -38,13 +36,8 @@ namespace LeafWeb.Web.ViewModels.LeafInput
|
||||
|
||||
static CreateViewModel()
|
||||
{
|
||||
var config =
|
||||
new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<CreateViewModel, Core.Entities.LeafInput>()
|
||||
.ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
|
||||
});
|
||||
Mapper = config.CreateMapper();
|
||||
Mapper.CreateMap<CreateViewModel, Core.Entities.LeafInput>()
|
||||
.ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
|
||||
}
|
||||
|
||||
public Core.Entities.LeafInput GetFileInput(DataService db)
|
||||
|
||||
Reference in New Issue
Block a user