This commit is contained in:
2016-08-08 14:47:35 -04:00
commit 0b0cb7c73a
156 changed files with 114318 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
using AutoMapper;
using Heroic.AutoMapper;
using InventoryTraker.Web.Core;
namespace InventoryTraker.Web.Models
{
public class ProfileForm : IMapFrom<User>, IHaveCustomMappings
{
[Required, Display(Name = "Full Name", Prompt = "Full Name (ex: John Doe)...")]
public string FullName { get; set; }
[Required, DataType(DataType.EmailAddress), Display(Prompt = "your@email.com...")]
public string EmailAddress { get; set; }
public void CreateMappings(IMapperConfiguration configuration)
{
configuration.CreateMap<User, ProfileForm>()
.ForMember(d => d.FullName, opt => opt.MapFrom(s => s.UserName))
.ForMember(d => d.EmailAddress, opt => opt.MapFrom(s => s.Email));
}
}
}