protected override void Configure() { WhenMapping .From <GrandParent>() .To <GrandParentDto>() .Map(ctx => ctx.Source.DatChild) .To(dto => dto.MyChild); }
private void MapBakim() { WhenMapping .From <BakimEntity>() .To <BakimModel>() .IgnoreTargetMembersWhere(m => m.HasAttribute <IgnoreMappingAttribute>()); GetPlansFor <BakimEntity>().To <BakimModel>(); }
protected override void Configure() { WhenMapping .From <Child>() .To <ChildDto>() .Map(ctx => ctx.Source.IsMyCountGtrZero(ctx.GetService <List <int> >())).To(o => o.IsMyCountGtrZero); GetPlansFor <Child>().To <ChildDto>(); }
protected override void Configure() { WhenMapping .From <PublicField <string> >() .ToANew <PublicField <int> >() .Map(ctx => ctx.Source.Value + "10") .To(t => t.Value); GetPlansFor <PublicField <string> >().To <PublicField <int> >(); }
private void MapOrtak() { WhenMapping .From <KullaniciEntity>() .To <SelectModel>() .Map((e, dto) => e.Ad) .To(dto => dto.Name) .And .Map((e, dto) => e.Id) .To(dto => dto.Key) ; GetPlansFor <KullaniciEntity>().To <SelectModel>(); }
protected override void Configure() { var dataByKey = GetService <Dictionary <string, object> >(); if (dataByKey == null) { return; } WhenMapping .From <Address>() .To <Address>() .Before.MappingBegins .Call(ctx => dataByKey["SourceAddress"] = ctx.Source) .And .After.MappingEnds .Call(ctx => dataByKey["TargetAddress"] = ctx.Target); }
protected override void Configure() { WhenMapping .From <Product>() .To <Areas.Catalog.Models.ProductsViewModel.ProductDTO>() .Map(ctx => ctx.Source.ProductPrice.Price) .To(dto => dto.Price); WhenMapping .From <Areas.Catalog.Models.EditProductViewModel>() .Over <Product>() .Map(ctx => ctx.Source.Price) .To(domain => domain.ProductPrice.Price); // Cache all Product -> ProductDto mapping plans: GetPlansFor <Product>().To <Areas.Catalog.Models.ProductsViewModel.ProductDTO>(); GetPlanFor <Areas.Catalog.Models.EditProductViewModel>().Over <Product>(); }