Пример #1
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <Message, MessagePM>()
     .ForMember(pm => pm.SenderFullName, opt => opt.Ignore())
     .ForMember(pm => pm.ReceiverFullName, opt => opt.Ignore())
     .ForMember(pm => pm.CreateDateString, opt => opt.Ignore());
     profile.CreateMap <MessagePM, Message>();
 }
Пример #2
0
        public static void CreateMap(AutoMapperProfile profile)
        {
            profile.CreateMap <Comment, CommentInfoPM>()
            .ForMember(pm => pm.SenderFullName, opt => opt.Ignore())
            .ForMember(pm => pm.CreateDateString, opt => opt.Ignore())
            .ForMember(pm => pm.ContentTitle, opt => opt.MapFrom(model => model.Content.Title));
            profile.CreateMap <CommentInfoPM, Comment>();

            profile.CreateMap <CommentRegistrationPM, Comment>();
        }
        public static void CreateMap(AutoMapperProfile profile)
        {
            profile.CreateMap <BlogGeneralSettingsPM, Blog>();
            profile.CreateMap <Blog, BlogGeneralSettingsPM>();

            profile.CreateMap <Blog, ShortBlogInfoPM>();
            profile.CreateMap <Blog, BlogInfoPM>()
            .ForMember(pm => pm.CreatorFullName, opt => opt.Ignore());

            profile.CreateMap <Blog, BlogInfoForGenerateLinkPM>();
        }
Пример #4
0
        public static void CreateMap(AutoMapperProfile profile)
        {
            profile.CreateMap <UserRegistrationPM, User>();

            // UserInfoPm
            profile.CreateMap <User, UserInfoPm>()
            .ForMember(pm => pm.FullName, opt => opt.Ignore())
            .ForMember(pm => pm.IsApproved, opt => opt.MapFrom(model => model.Membership.IsApproved))
            .ForMember(pm => pm.IsLockedOut, opt => opt.MapFrom(model => model.Membership.IsLockedOut));

            profile.CreateMap <User, AdminDashboardNewUserPm>()
            .ForMember(pm => pm.FullName, opt => opt.Ignore())
            .ForMember(pm => pm.ImageUrl, opt => opt.Ignore());


            // UserInfoPm
            profile.CreateMap <User, ProfileGeneralSettingsPM>();
        }
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <Organization, OrganizationPM>();
     profile.CreateMap <OrganizationPM, Organization>();
 }
Пример #6
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <Job, JobPM>();
     profile.CreateMap <JobPM, Job>();
 }
Пример #7
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <Notification, NotificationPM>()
     .ForMember(pm => pm.CreateDateString, opt => opt.Ignore());
 }
Пример #8
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <EducationalResume, EducationalResumePM>();
     profile.CreateMap <EducationalResumePM, EducationalResume>();
 }
Пример #9
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <UniversityField, UniversityFieldPM>();
     profile.CreateMap <UniversityFieldPM, UniversityField>();
 }
Пример #10
0
 public void ConfigureMapping(AutoMapperProfile profile)
 => profile.CreateMap <Room, RoomModel>();
Пример #11
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <JobResume, JobResumePM>();
     profile.CreateMap <JobResumePM, JobResume>();
 }
Пример #12
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <Media, MediaPM>();
     profile.CreateMap <MediaPM, Media>();
 }
Пример #13
0
        public static void CreateMap(AutoMapperProfile profile)
        {
            // ContentDetailsPM
            profile.CreateMap <Content, ContentRegistrationPM>()
            .ForMember(pm => pm.Published, opt => opt.MapFrom(model => model.State == ContentState.Published))
            .ForMember(pm => pm.AuthorFullName, opt => opt.MapFrom(model => model.Author.FullName));

            profile.CreateMap <Content, ContentForViewByVisitorPM>()
            .ForMember(pm => pm.Published, opt => opt.MapFrom(model => model.State == ContentState.Published))
            .ForMember(pm => pm.CreateDateString, opt => opt.Ignore())
            .ForMember(pm => pm.AuthorFullName, opt => opt.MapFrom(model => model.Author.FullName));

            profile.CreateMap <ContentRegistrationPM, Content>()
            .ForMember(model => model.State, opt => opt.MapFrom(pm => pm.Published ? ContentState.Published : ContentState.UnPublished));

            // ContentInfoPM
            profile.CreateMap <Content, ContentInfo1PM>()
            .ForMember(pm => pm.AuthorFirstName, opt => opt.MapFrom(model => model.Author.FirstName))
            .ForMember(pm => pm.AuthorLastName, opt => opt.MapFrom(model => model.Author.LastName))
            .ForMember(pm => pm.AuthorFullName, opt => opt.Ignore())
            .ForMember(pm => pm.CommentsCount, opt => opt.MapFrom(model => model.Comments.Count()))
            .ForMember(pm => pm.VisitsCount, opt => opt.MapFrom(model => model.Visits.Count()));

            // ContentInfoWithTextPM
            profile.CreateMap <Content, ContentInfoWithTextPM>()
            .ForMember(pm => pm.AuthorId, opt => opt.MapFrom(model => model.Author.Id))
            .ForMember(pm => pm.AuthorFirstName, opt => opt.MapFrom(model => model.Author.FirstName))
            .ForMember(pm => pm.AuthorLastName, opt => opt.MapFrom(model => model.Author.LastName))
            .ForMember(pm => pm.AuthorFullName, opt => opt.Ignore())
            .ForMember(pm => pm.Tags, opt => opt.MapFrom(model =>
                                                         model.Tags.Select(tag => new TagPM()
            {
                Id = tag.Id, Text = tag.Text
            })))
            .ForMember(pm => pm.CommentsCount, opt => opt.MapFrom(model => model.Comments.Count()));

            // ContentInfoForHomePage
            profile.CreateMap <Content, ContentInfo6PM>()
            .ForMember(pm => pm.AuthorFullName, opt => opt.Ignore())
            .ForMember(pm => pm.PublishDateString, opt => opt.Ignore())
            .ForMember(pm => pm.Tags, opt => opt.MapFrom(model =>
                                                         model.Tags.Select(tag => new TagPM()
            {
                Id = tag.Id, Text = tag.Text
            }).Take(6)))
            .ForMember(pm => pm.AuthorId, opt => opt.MapFrom(model => model.Author.Id))
            .ForMember(pm => pm.AuthorFirstName, opt => opt.MapFrom(model => model.Author.FirstName))
            .ForMember(pm => pm.AuthorLastName, opt => opt.MapFrom(model => model.Author.LastName));

            // ContentInfoForHomePage
            profile.CreateMap <Content, ContentInfo5PM>()
            .ForMember(pm => pm.PublishDateString, opt => opt.Ignore())
            .ForMember(pm => pm.CreateDateString, opt => opt.Ignore())
            .ForMember(pm => pm.Published, opt => opt.MapFrom(model => model.State == ContentState.Published))
            .ForMember(pm => pm.CommentsCount, opt => opt.MapFrom(model => model.Comments.Count()));

            // ContentInfoForGeneratingLink
            profile.CreateMap <Content, ContentInfo4PM>();

            // ContentInfoForGeneratingLink
            profile.CreateMap <Content, ContentInfo2PM>()
            .ForMember(pm => pm.CreateDateString, opt => opt.Ignore());

            // AdminDashboardNewArticlePm
            profile.CreateMap <Content, AdminDashboardNewArticlePm>()
            .ForMember(pm => pm.AuthorFirstName, opt => opt.MapFrom(model => model.Author.FirstName))
            .ForMember(pm => pm.AuthorLastName, opt => opt.MapFrom(model => model.Author.LastName))
            .ForMember(pm => pm.AuthorFullName, opt => opt.Ignore())
            .ForMember(pm => pm.PublishDateString, opt => opt.Ignore());

            profile.CreateMap <Content, ContentInfo3PM>()
            .ForMember(pm => pm.AuthorFullName, opt => opt.Ignore())
            .ForMember(pm => pm.CreateDateString, opt => opt.Ignore())
            .ForMember(pm => pm.AuthorFirstName, opt => opt.MapFrom(model => model.Author.FirstName))
            .ForMember(pm => pm.AuthorLastName, opt => opt.MapFrom(model => model.Author.LastName))
            .ForMember(pm => pm.Tags, opt => opt.MapFrom(model =>
                                                         model.Tags.Select(tag => new TagPM()
            {
                Id = tag.Id, Text = tag.Text
            })));
        }
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <DomainModel.ProfileKeyValue, ProfileForViewByVisitorPM>();
     profile.CreateMap <ProfileForViewByVisitorPM, DomainModel.ProfileKeyValue>();
 }
Пример #15
0
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <Tag, TagPM>();
     profile.CreateMap <TagPM, Tag>();
 }
 public static void CreateMap(AutoMapperProfile profile)
 {
     profile.CreateMap <BlogLink, BlogLinkPM>();
     profile.CreateMap <BlogLinkPM, BlogLink>();
 }