PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Samples/Blog/Bifrost.Samples.Blog.Mvc/Features/Products/ProductsController.cs

#
C# | 31 lines | 25 code | 4 blank | 2 comment | 1 complexity | 856d06b86bd0e9377d5d08a113172b0d MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Web.Mvc;
 4
 5namespace Bifrost.Samples.Shop.Mvc.Features.Products
 6{
 7    public class ProductsController : Controller
 8    {
 9        //
10        // GET: /Posts/
11
12        public ActionResult Index()
13        {
14        	var products = new List<Product>();
15			for(int i = 1; i <= 10; i++)
16			{
17				var product = new Product
18				              	{
19									Id = Guid.NewGuid(),
20									MaterialNumber =  i.ToString(),
21				              		Title = "Product #" + i,
22				              		Description = "Something"
23				              	};
24				products.Add(product);
25			}
26
27            return View(products);
28        }
29
30    }
31}