Skip to content

Instantly share code, notes, and snippets.

@SaraJo
Created October 28, 2009 08:49
Show Gist options
  • Save SaraJo/220359 to your computer and use it in GitHub Desktop.
Save SaraJo/220359 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Transportation.ViewModels;
using Transportation.Models;
namespace Transportation.Controllers
{
[HandleError]
public class HomeController : Controller
{
public ActionResult ListVehicles()
{
List<Car> cars = new List<Car>
{new Car{Make = "Honda", Model="Accord"},
new Car{Make = "Acura", Model="Integra"}};
Train train = new Train { Line = "NorthEast Corridor", Schedule = "Monday at 8" };
TransportationViewModel t = new TransportationViewModel
{
Cars = cars,
Train = train
};
return View(t);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment