using System.Collections.Generic;
namespace HelloWorldMvcApp
public class HomeController : Controller
public ActionResult Index()
var productsList = new List<Product>
new Product{Id= 1,Display = "Product 1", Description = "prod 1 description"},
new Product{Id= 2,Display = "Product 2", Description = "prod 2 description"},
new Product{Id= 3,Display = "Product 3", Description = "prod 3 description"},
new Product{Id= 4,Display = "Product 4", Description = "prod 4 description"},
new Product{Id= 5,Display = "Product 5", Description = "prod 5 description"},
ViewBag.Products = productsList;
public JsonResult GetAnswer(string question)
int index = _rnd.Next(_db.Count);
private static Random _rnd = new Random();
private static List<string> _db = new List<string> { "Yes", "No", "Definitely, yes", "I don't know", "Looks like, yes"} ;