Advertisement
ekioISpro

Untitled

Oct 27th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. namespace CoreCodeCamp.Data.Models
  2. {
  3.     public class CampDto
  4.     {
  5.         [Required] [StringLength(100)] public string Name { get; set; }
  6.  
  7.         [Required] public string Moniker { get; set; }
  8.  
  9.         public DateTime EventDate { get; set; } = DateTime.MinValue;
  10.  
  11.         [Range(1, 100)] public int Length { get; set; } = 1;
  12.  
  13.         public string Venue { get; set; }
  14.         public string LocationAddress1 { get; set; }
  15.         public string LocationAddress2 { get; set; }
  16.         public string LocationAddress3 { get; set; }
  17.         public string LocationCityTown { get; set; }
  18.         public string LocationStateProvince { get; set; }
  19.         public string LocationPostalCode { get; set; }
  20.         public string LocationCountry { get; set; }
  21.         public ICollection<TalkDto> Talks { get; set; }
  22.     }
  23. }
  24.  
  25. namespace CoreCodeCamp.Data
  26. {
  27.     public class CampProfile : Profile
  28.     {
  29.         public CampProfile()
  30.         {
  31.             this.CreateMap<Camp, CampDto>()
  32.                 .ForMember(c => c.Venue, o => o.MapFrom(c => c.Location.VenueName)).ReverseMap();
  33.             CreateMap<Talk, TalkDto>().ReverseMap();
  34.             this.CreateMap<Speaker, SpeakerDto>().ReverseMap();
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement