public static DummiesAllPageMetadata MapToDummiesAllPageMetadata(DummiesAllViewModel source) { var target = new DummiesAllPageMetadata(); Map(source, target); return(target); }
public ActionResult DummiesAllNextPage(DummiesAllPageMetadata metadata) { // Use page metadata to retrieve data via service var domainModel = DummyService.FindAll(metadata.StartsWith); // Populate grid property with data and page metadata // Note that in the mapping, both the source and destination types are specified, // and a new Pageable instance (with page metadata) is created for use as the destination object (so page metadata is kept) var data = ExampleMapper.ToPageableDummyViewModel(domainModel, new Pageable <DummyViewModel>(metadata)); // MappingEngine.Map<IEnumerable<DummyModel>, IPageable<DummyViewModel>>(domainModel, new Pageable<DummyViewModel>(metadata)); // Note that we are returning PagedView instead of View return(PagedView(data)); }
public static void Map(DummiesAllViewModel source, DummiesAllPageMetadata target) { target.StartsWith = source.StartsWith; }