internal void OnTypeMapping(object sender, AutoMapper.Profile profile) { if (TypeMapping != null) { TypeMapping(sender, profile); } }
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <Client, ClientDetailDto>() .ForMember(d => d.IdResponsable, opt => opt.MapFrom(s => s.IdResponsable)) .ForMember(d => d.Civilite, opt => opt.MapFrom(s => (Civilite)s.Civilite)) .ForMember(d => d.Categorie, opt => opt.MapFrom(s => (CategorieClient)s.Categorie)); }
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <Purchase, PurchasedFactorVm>() .ForMember(dst => dst.Amount, opt => opt.MapFrom(src => src.Amount.ToString(CultureInfo.InvariantCulture) + " " + src.Currency.Title)); }
public void Mapper(AutoMapper.Profile mapper) => mapper .CreateMap <Workout, WorkoutOutputModel>() .ForMember(x => x.WorkoutTypeName, cfg => cfg.MapFrom(x => x.WorkoutType.Name)) .ForMember(x => x.WorkoutTypeId, cfg => cfg.MapFrom(x => x.WorkoutTypeId));
public void MapFrom(AutoMapper.Profile profile) => profile .CreateMap <BankAccount, BankAccountEntity>() .ForMember(x => x.AuditID, opt => opt.Ignore()) .ForMember(x => x.Audit, opt => opt.Ignore()) .ForMember(x => x.OwnerID, opt => opt.Ignore()) .ForMember(x => x.Owner, opt => opt.Ignore()) .ForMember(x => x.Currency, opt => opt.Ignore());
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <Declarant, DeclarantDto>() .ForMember(d => d.Id, opt => opt.MapFrom(s => s.Id)) .ForMember(d => d.Civilite, opt => opt.MapFrom(s => (Civilite)s.Civilite)) .ForMember(d => d.SituationFamiliale, opt => opt.MapFrom(s => (SituationFamiliale)s.SituationFamiliale)) .ForMember(d => d.Civilite, opt => opt.MapFrom(s => (Civilite)s.Civilite)) .ForMember(d => d.TypeDeclarant, opt => opt.MapFrom(s => (Civilite)s.TypeDeclarant)); }
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <Client, TachePersonneDto>() .ForMember(d => d.Id, opt => opt.MapFrom(s => s.Id)); profile.CreateMap <IApplicationUser, TachePersonneDto>() .ForMember(d => d.Id, opt => opt.MapFrom(s => s.Id)) .ForMember(d => d.Nom, opt => opt.MapFrom(s => s.Utilisateur.Nom)) .ForMember(d => d.Prenom, opt => opt.MapFrom(s => s.Utilisateur.Prenom)); }
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <Tache, TacheDto>() .ForMember(d => d.Client, opt => opt.MapFrom(x => x.Client)) // .ForMember(d => d.Responsable, opt => opt.MapFrom(x => x.UtilisateurNavigation ?? x.Client.Responsable)) .ForMember(d => d.StatutTache, opt => opt.MapFrom(x => (StatutTache)x.StatutTache)) // id tache .ForMember(d => d.IdTache, opt => opt.MapFrom(s => s.Id)) //si tache en retard .ForMember(d => d.EnRetard, opt => opt.MapFrom(t => t.Echeance < DateTime.Now)); }
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <AppUser, ProfileDto>() .ForMember(d => d.Image, opt => opt.MapFrom(src => src.Photos.FirstOrDefault(x => x.IsMain).Url)) .ForMember(d => d.FollowingCount, opt => opt.MapFrom(src => src.Followings.Count())) .ForMember(d => d.FollowersCount, opt => opt.MapFrom(src => src.Followers.Count())); }
public static void AddBusinessLayerMaps(this AutoMapper.Profile profile) { profile.CreateMap <UserDTO, IdentityUser>(); profile.CreateMap <IdentityUser, UserDTO>(); profile.CreateMap <RoomDTO, Room>(); profile.CreateMap <Room, RoomDTO>(); profile.CreateMap <BoardStateDTO, BoardState>(); profile.CreateMap <BoardState, BoardStateDTO>(); profile.CreateMap <TrackDTO, Track>() .ForMember(track => track.Steps, opt => opt.MapFrom(s => s.Steps.ConvertToString())); profile.CreateMap <Track, TrackDTO>() .ForMember(trackDTO => trackDTO.Steps, opt => opt.MapFrom(track => track.Steps.ConvertToBoolList())); }
public void MapTo(AutoMapper.Profile profile) => profile.CreateMap <BankAccountCreateRequestDto, BankAccount>() .ForMember(x => x.BankAccountID, opt => opt.Ignore());
public void CreateMappings(AutoMapper.Profile configuration) { configuration.CreateMap <CreateRoleQuery, Domain.Identity.Role>(); }
public void MapFrom(AutoMapper.Profile profile) => profile .CreateMap <BankAccountTransaction, BankAccountTransactionEntity>() .ForMember(x => x.AuditID, opt => opt.Ignore()) .ForMember(x => x.Audit, opt => opt.Ignore());
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <UserProfile, UserProfileVm>() .ForMember(dst => dst.ProvinceId, opt => opt.MapFrom(src => src.ProvinceId == 0 ? null as int? : src.ProvinceId)) .ForMember(dst => dst.CityId, opt => opt.MapFrom(src => src.CityId == 0 ? null as int? : src.CityId)); }
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <Report, ReportViewModel>() .ForMember(r => r.Date, cfg => cfg.MapFrom(r => r.DateOfCreation.ToShortDateString())) .ForMember(r => r.Reporter, cfg => cfg.MapFrom(r => r.Reporter.UserName)) .ForMember(r => r.Reported, cfg => cfg.MapFrom(r => r.ReportedUser.UserName));
public void ConfigureMapping(AutoMapper.Profile profile) => profile .CreateMap <Product, ProductViewModel>() .ForMember(p => p.Image, cfg => cfg.MapFrom(p => p.Images.First()));
// TODO: Resolve mapping of properties from BankAccountTransactionEntity to BankAccountTransaction public void MapTo(AutoMapper.Profile profile) => profile .CreateMap <BankAccountTransactionEntity, BankAccountTransaction>() .ForMember(x => x.PayeeName, opt => opt.Ignore()) .ForMember(x => x.Symbol, opt => opt.Ignore()) .ForMember(x => x.DecimalFormat, opt => opt.Ignore()) .ForMember(x => x.Balance, opt => opt.Ignore());
public void Mapping(AutoMapper.Profile mapper) => mapper .CreateMap <Workout, WorkoutListingModel>() .ForMember(x => x.WorkoutTypeName, cfg => cfg.MapFrom(x => x.WorkoutType.Name));
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <User, UserViewModel>() .ForMember(u => u.Orders, cfg => cfg.MapFrom(u => u.PurchaseOrders.Count)) .ForMember(u => u.Products, cfg => cfg.MapFrom(u => u.MyProducts.Count)) .ForMember(u => u.Reports, cfg => cfg.MapFrom(u => u.Reports.Count));
public void ConfigureMapping(AutoMapper.Profile profile) => profile .CreateMap <Product, WishlistViewModel>() .ForMember(p => p.Image, cfg => cfg.MapFrom(p => p.Images.First())) .ForMember(p => p.Sizes, cfg => cfg.MapFrom(p => p.Sizes.Select(s => s.Map <ProductSize, SizeViewModel>())));
public void Mapping(AutoMapper.Profile profile) { profile.CreateMap <FinancialInfo, FinancialInfoVm>() .ForMember(dst => dst.BankName, opt => opt.MapFrom(src => src.Bank.Title)); }
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <Order, OrderDetailsViewModel>() .ForMember(o => o.UserInfo, cfg => cfg.MapFrom(o => o.Buyer.UserInfo.Map <UserInfo, UserInfoViewModel>()));
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <Review, ReviewViewModel>() .ForMember(r => r.User, cfg => cfg.MapFrom(r => r.User.UserName));
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <ProductSize, SizeViewModel>() .ForMember(s => s.Name, cfg => cfg.MapFrom(p => p.Size.Name)) .ForMember(s => s.Id, cfg => cfg.MapFrom(p => p.Size.Id));
public void MapFrom(AutoMapper.Profile profile) => profile .CreateMap <Document, DocumentEntity>() .ForMember(x => x.OwnerID, opt => opt.Ignore()) .ForMember(x => x.AuditID, opt => opt.Ignore()) .ForMember(x => x.Audit, opt => opt.Ignore());
public void MapFrom(AutoMapper.Profile profile) => profile .CreateMap <Currency, CurrencyEntity>() .ForMember(x => x.IsDeprecated, opt => opt.Ignore());
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <Order, OrderViewModel>() .ForMember(o => o.Buyer, cfg => cfg.MapFrom(o => o.Buyer.UserName)) .ForMember(o => o.Seller, cfg => cfg.MapFrom(o => o.Seller.UserName));
public void MapFrom(AutoMapper.Profile profile) => profile .CreateMap <BankAccountType, BankAccountTypeEntity>() .ForMember(x => x.AllowPersonal, opt => opt.Ignore()) .ForMember(x => x.AllowCompany, opt => opt.Ignore()) .ForMember(x => x.IsDeprecated, opt => opt.Ignore());
public void Mapping(AutoMapper.Profile mappre) => mappre .CreateMap <ExcerciseWorkout, ExcerciseInWorkoutListingModel>() .ForMember(x => x.ExcerciseName, cfg => cfg.MapFrom(x => x.Excercise.Name));
public void ConfigureMapping(AutoMapper.Profile profile) => profile.CreateMap <Product, ProductDetailsViewModel>() .ForMember(p => p.Sizes, cfg => cfg.MapFrom(p => p.Sizes.Where(s => s.Quantity > 0).Select(s => s.Map <ProductSize, SizeViewModel>()))) .ForMember(p => p.Orders, cfg => cfg.MapFrom(p => p.Orders.Count)) .ForMember(p => p.Reviews, cfg => cfg.MapFrom(p => p.Reviews.Select(s => s.Map <Review, ReviewViewModel>()))) .ForMember(p => p.Views, cfg => cfg.MapFrom(p => p.ViewsCount));