using System;
using System.ComponentModel.DataAnnotations;
namespace HelloWorldMvcApp
{
public class Foo
public string Value {get;set;}
}
public class Bar
}}
@model Tuple<HelloWorldMvcApp.Foo, HelloWorldMvcApp.Bar>
@{
Layout = null;
<!DOCTYPE html>
<!-- template from http://getbootstrap.com/getting-started -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">
Foo value = @Model.Item1.Value
<hr />
Bar value = @Model.Item2.Value
</div>
</body>
</html>
using System.Web.Mvc;
using System.Collections.Generic;
public class HomeController : Controller
[HttpGet]
public ActionResult Index()
return View(new Tuple<Foo, Bar>(new Foo { Value = "foo" }, new Bar { Value = "bar" }));