/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
Possible License(s): CC-BY-SA-3.0
- using System;
- using System.Collections.Generic;
- using System.Web.Mvc;
-
- namespace Bifrost.Samples.Shop.Mvc.Features.Products
- {
- public class ProductsController : Controller
- {
- //
- // GET: /Posts/
-
- public ActionResult Index()
- {
- var products = new List<Product>();
- for(int i = 1; i <= 10; i++)
- {
- var product = new Product
- {
- Id = Guid.NewGuid(),
- MaterialNumber = i.ToString(),
- Title = "Product #" + i,
- Description = "Something"
- };
- products.Add(product);
- }
-
- return View(products);
- }
-
- }
- }