Exemplo n.º 1
0
        public ActionResult Exemple6()
        {
            //Default page
            ViewBag.Message = "List Exemple for custom mapping";
            //this exemple show how map a IQueryable to List  with custom mapping
            ExempleOrder exemple6 = new ExempleOrder();
            List<OrderModel> model = null;
            var result = exemple6.GetOrders();
            //see sql request in console output
            model = result.Select<Order, OrderModel>().ToList();

            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Exemple5()
        {
            //Default page
            ViewBag.Message = "Exemple for custom mapping";
            //this exemple show the map with custom mapping
            ExempleOrder exemple5 = new ExempleOrder();

            var result = exemple5.GetFirstOrder();

            var model = Mapper<OrderModel>.Map(result);

            return View(model);
        }