示例#1
0
        public static DummiesMainframePageMetadata MapToDummiesMainframePageMetadata(DummiesModel source)
        {
            var target = new DummiesMainframePageMetadata();

            Map(source, target);
            return(target);
        }
示例#2
0
        public ActionResult DummiesMainframeNextPage(DummiesMainframePageMetadata metadata)
        {
            // Use page metadata to retrieve data via service
            var domainModel = DummyService.Find(metadata.StartsWith, metadata.NextSequenceID);

            // Note when mainframe is paging, we need to update the page metadata that is specifically used by mainframe for paging
            //metadata = ExampleMapper.MapToDummiesMainframePageMetadata(domainModel, metadata);// MappingEngine.Map<DummiesModel, DummiesMainframePageMetadata>(domainModel, metadata);
            ExampleMapper.Map(domainModel, metadata);

            // 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.Dummies, new Pageable <DummyViewModel>(metadata));// MappingEngine.Map<IEnumerable<DummyModel>, IPageable<DummyViewModel>>(domainModel.Dummies, new Pageable<DummyViewModel>(metadata));

            // Note that we are returning PagedView instead of View
            return(PagedView(data));
        }
示例#3
0
 public static void Map(DummiesModel source, DummiesMainframePageMetadata target)
 {
     target.NextSequenceID = source.NextSequenceID;
 }
示例#4
0
 public static void Map(DummiesMainframeViewModel source, DummiesMainframePageMetadata target)
 {
     target.StartsWith = source.StartsWith;
 }