/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

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