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)); }
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; var result = exemple6.GetOrders(); // See sql request in console output. model = result.Select <Order, OrderModel>().ToList(); return(View(model)); }