예제 #1
0
        public void Mapping(MappingProfile profile)
        {
            profile.CreateMap <ServiceCategory, CategoryModel>()
            .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.CategoryId))
            .ForMember(dest => dest.CategoryName, opt => opt.MapFrom(src => src.Category.CategoryName));

            profile.CreateMap <Category, CategoryModel>().ReverseMap();
        }
예제 #2
0
 public static void Map(MappingProfile profile)
 {
     profile.CreateMap <ContentObject, DetailedContentDto>()
     .ForMember(des => des.TaxonomyTerms, map => map.MapFrom(src => src.TaxonomyTerms.Select(x => x.Term)))
     .ForMember(des => des.CustomFields, map => map.MapFrom(src => src.CustomFields.Where(x => !x.IsPrivate)));
     profile.CreateMap <AthenaUser, DetailedCreatedByDto>();
     profile.CreateMap <CustomField, DetailedCustomFieldDto>()
     .ForMember(des => des.Private, map => map.MapFrom(src => src.IsPrivate))
     .ForMember(des => des.Protected, map => map.MapFrom(src => src.IsProtected));
     profile.CreateMap <TaxonomyTerm, DetailedTermDto>();
     profile.CreateMap <ContentType, DetailedContentTypeDto>();
 }
예제 #3
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Entities.Candidate, CandidateUpdatedVm>()
     .ForMember(dest => dest.CandidateBasicDataId, opt => opt.MapFrom(src => src.BasicData.Id))
     .ForMember(dest => dest.Educations, opt => opt.MapFrom(src => src.Educations.Select(ed => ed.Id)))
     .ForMember(dest => dest.Experiences, opt => opt.MapFrom(src => src.Experiences.Select(ex => ex.Id)));
 }
예제 #4
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <UpdateCandidateCommand, Candidate>()
     .ForMember(dest => dest.BasicData, opt => opt.MapFrom(src => src.CandidateBasicData))
     .ForMember(dest => dest.Educations, opt => opt.Ignore())
     .ForMember(dest => dest.Experiences, opt => opt.Ignore())
     .ForMember(dest => dest.Id, opt => opt.Ignore());
 }
 public static void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Project, DetailedProjectDto>()
     .ForMember(
         dest => dest.ProjectSteps,
         opt => opt.MapFrom(
             src => src.Steps))
     .ReverseMap();
 }
예제 #6
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Model.Ad, AdForListVm>()
     .ForMember(s => s.CarLocation, opt => opt.MapFrom(s => s.AdLocation))
     .ForMember(s => s.OdometerValue, opt => opt.MapFrom(s => s.CarSpecification.OdometerValue))
     .ForMember(s => s.FuelType, opt => opt.MapFrom(s => s.CarSpecification.FuelType))
     .ForMember(s => s.CarBrand, opt => opt.MapFrom(s => s.CarSpecification.CarModel.CarBrand.Brand))
     .ForMember(s => s.CarModel, opt => opt.MapFrom(s => s.CarSpecification.CarModel.Model));
 }
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Model.Customer, CustomerDetailsVm>()
     .ForMember(s => s.Name, opt => opt.MapFrom(s => s.FirstName + " " + s.LastName))
     .ForMember(s => s.PhoneNumbers, opt => opt.Ignore())
     .ForMember(s => s.Adresses, opt => opt.Ignore())
     .ForMember(s => s.Ad, opt => opt.Ignore())
     ;
 }
예제 #8
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Model.Owner, OwnerToListVm>()
     .ForMember(d => d.ContactInfo, opt => opt.MapFrom(s => s.Contact.Email))
     .ForMember(d => d.Id, opt => opt.MapFrom(s => s.Id))
     .ForMember(d => d.LastName, opt => opt.MapFrom(s => s.LastName))
     .ForMember(d => d.FirstName, opt => opt.MapFrom(s => s.FirstName))
     .ForMember(d => d.ContactInfo, opt => opt.MapFrom(s => s.Contact.Email + " " + s.Contact.Tel));
 }
 public static MapperConfiguration CreateReadConfig<TEntity, TDto>(Action<IMappingExpression<TEntity, TDto>> alterMapping)
 {
     var readProfile = new MappingProfile(false);
     alterMapping(readProfile.CreateMap<TEntity, TDto>());
     var readConfig = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile(readProfile);
     });
     return readConfig;
 }
예제 #10
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Model.Owner, NewOwnerVm>().ReverseMap();
     //profile.CreateMap<Contact, NewContactVm>();
     //profile.CreateMap<Contact, NewOwnerVm>();
     //.ForPath(d => d.Contact.Email, opt => opt.MapFrom(s => s.Email))
     //.ForPath(d => d.Contact.Tel, opt => opt.MapFrom(s => s.Tel))
     //.ForPath(d => d.Contact.OwnerRef, opt => opt.MapFrom(s => s.OwnerRef))
     //.ForPath(d => d.Contact.Id, opt => opt.MapFrom(s => s.Id))
     //.ForPath(d => d.Contact.Owner, opt => opt.MapFrom(s => s.Owner));
 }
        //public List<ContactDetailsListVm> PhoneNumbers { get; set; }


        public void Mapping(MappingProfile profile)
        {
            profile.CreateMap <Domain.Model.Ad, AdDetailsVm>()
            .ForMember(s => s.CarLocation, opt => opt.MapFrom(s => s.AdLocation))
            .ForMember(s => s.OdometerValue, opt => opt.MapFrom(s => s.CarSpecification.OdometerValue))
            .ForMember(s => s.FuelType, opt => opt.MapFrom(s => s.CarSpecification.FuelType))
            .ForMember(s => s.CarEquipment, opt => opt.MapFrom(s => s.CarSpecification.Equipment))
            .ForMember(s => s.NumberOfCylinders, opt => opt.MapFrom(s => s.CarSpecification.NumberOfCylinders))
            .ForMember(s => s.DriveTrain, opt => opt.MapFrom(s => s.CarSpecification.DriveTrain))
            .ForMember(s => s.CarBrand, opt => opt.MapFrom(s => s.CarSpecification.CarModel.CarBrand.Brand))
            .ForMember(s => s.CarModel, opt => opt.MapFrom(s => s.CarSpecification.CarModel.Model));
        }
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Person, GetPersonInfoRelatedPersonInfoDto>()
     .ForMember(d => d.FirstName, opt => opt.MapFrom(s => s.Name.FirstName))
     .ForMember(d => d.LastName, opt => opt.MapFrom(s => s.Name.LastName))
     .ForMember(d => d.PersonalNumber, opt => opt.MapFrom(s => s.PersonalNumber.Value))
     .ForMember(d => d.BirthDate, opt => opt.MapFrom(s => s.BirthDate.Value))
     .ForMember(d => d.ImagePath, opt => opt.MapFrom(s => !string.IsNullOrWhiteSpace(s.ImagePath) ? Path.Combine(profile.PhotoUploadService.GetWebRootPath(), s.ImagePath) : null))
     .ForMember(d => d.GenderTypeId, opt => opt.MapFrom(s => s.GenderTypeId))
     .ForMember(d => d.GenderTypeName, opt => opt.MapFrom(s => s.GenderType.Name))
     .ForMember(d => d.CityId, opt => opt.MapFrom(s => s.CityId))
     .ForMember(d => d.CityName, opt => opt.MapFrom(s => s.City.Name));
 }
예제 #13
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <NewAdVm, Domain.Model.Ad>()
     .ForPath(s => s.IsActive, opt => opt.MapFrom(s => true))
     .ForPath(s => s.CarSpecificationId, opt => opt.MapFrom(s => s.Id))
     .ForPath(s => s.AdLocation, opt => opt.MapFrom(s => s.Location))
     .ForPath(s => s.CarSpecification.CarModelId, opt => opt.MapFrom(s => s.CarModelIdFromList))
     .ForPath(s => s.CarSpecification.DriveTrain, opt => opt.MapFrom(s => s.DriveTrain))
     .ForPath(s => s.CarSpecification.FuelType, opt => opt.MapFrom(s => s.FuelType))
     .ForPath(s => s.CarSpecification.Generation, opt => opt.MapFrom(s => s.CarGeneration))
     .ForPath(s => s.CarSpecification.NumberOfCylinders, opt => opt.MapFrom(s => s.NumberOfCylinders))
     .ForPath(s => s.CarSpecification.OdometerValue, opt => opt.MapFrom(s => s.OdometerValue))
     .ForPath(s => s.CarSpecification.ProductionYear, opt => opt.MapFrom(s => s.ProductionYear))
     .ForPath(s => s.ApplicationUserId, opt => opt.MapFrom(s => s.CustomerId))
     .ReverseMap();
 }
        public static AutoMapper.Profile CreateMappingProfile()
        {
            var mappingProfile = new MappingProfile();

            mappingProfile.CreateMap <ActivityEntity, ActivityModel>();
            mappingProfile.CreateMap <ActivityModel, ActivityEntity>();

            mappingProfile.CreateMap <MessageEntity, MessageModel>();
            mappingProfile.CreateMap <MessageModel, MessageEntity>();

            mappingProfile.CreateMap <UserBlockEntity, UserBlockModel>();
            mappingProfile.CreateMap <UserBlockModel, UserBlockEntity>();

            mappingProfile.CreateMap <UserEntity, UserModel>();
            mappingProfile.CreateMap <UserModel, UserEntity>();

            return(mappingProfile);
        }
        public static WrappedAndMapper CreateWrapperMapper<TDto, TEntity>()
        {
            var readProfile = new MappingProfile(false);
            readProfile.CreateMap<TEntity, TDto>();
            var readConfig = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(readProfile);
            });

            var saveProfile = new MappingProfile(true);
            saveProfile.CreateMap<TDto, TEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            var saveConfig = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(saveProfile);
            });
            return new WrappedAndMapper(new GenericServicesConfig(), readConfig, saveConfig);
        }
예제 #16
0
        private static AutoMapper.Profile CreateMappingProfile()
        {
            var mappingProfile = new MappingProfile();

            mappingProfile.CreateMap <LinkEntity, LinkModel>();
            mappingProfile.CreateMap <LinkModel, LinkEntity>();

            mappingProfile.CreateMap <UserEntity, UserModel>();
            mappingProfile.CreateMap <UserModel, UserEntity>();

            mappingProfile.CreateMap <VisitorEntity, VisitorModel>();
            mappingProfile.CreateMap <VisitorModel, VisitorEntity>();

            return(mappingProfile);
        }
예제 #17
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Entities.Candidate, CandidateDTO>()
     .ForMember(dest => dest.CandidateBasicData, opt => opt.MapFrom(src => src.BasicData));
 }
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <ExperienceForManipulationDTO, Domain.Entities.Experience>();
 }
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <ExperienceForUpdateDTO, Domain.Entities.Experience>();
 }
예제 #20
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Entities.Recruiter, RecruiterDTO>();
 }
예제 #21
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <JobOffer, JobOfferCreatedVm>()
     .ForMember(dest => dest.OwnerId, opt => opt.MapFrom(src => src.EmployeeId));
 }
예제 #22
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Domain.Entities.CandidateBasicData, CandidateBasicDataDTO>();
 }
예제 #23
0
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <JobPositionForManipulationDTO, Domain.Entities.JobPosition>();
 }
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <PersonBasicDataForManipulationDTO, Domain.Entities.PersonBasicData>();
 }
 public void Mapping(MappingProfile profile)
 {
     profile.CreateMap <DetailedTaskDto, Task>().ReverseMap();
 }
        //public Guid CandidateId { get; set; }

        public void Mapping(MappingProfile profile)
        {
            profile.CreateMap <CandidateBasicDataForUpdateDTO, Domain.Entities.CandidateBasicData>();
        }
 public static IMappingExpression <PaginationList <TEntityPagination>, PaginationList <TDTOPagination> > MapPagination <TEntityPagination, TDTOPagination>(this MappingProfile mapper) where TEntityPagination : class where TDTOPagination : class
 {
     return(mapper.CreateMap <PaginationList <TEntityPagination>, PaginationList <TDTOPagination> >()
            .ForMember(d => d.Rows, options => options.MapFrom(o => o.Rows)));
 }
 public static void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Step, ProjectStepDto>().ReverseMap();
 }
예제 #29
0
 public static void Mapping(MappingProfile profile)
 {
     profile.CreateMap <UpdateProjectAssignmentCommand, ProjectAssignment>();
 }
 public static void Mapping(MappingProfile profile)
 {
     profile.CreateMap <Task, StepTaskDto>().ReverseMap();
 }