using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using LanguageFeatures.Models;
using System;
using System.Linq;

namespace LanguageFeatures.Controllers
{
    public class HomeController : Controller
    {
        public ViewResult Index()
        {
            var products = new[] {
                new { Name = "Kajak", Price = 275M },
                new { Name = "Kamizelka ratunkowa", Price = 48.95M },
                new { Name = "Piłka nożna", Price = 19.50M },
                new { Name = "Flaga narożna", Price = 34.95M }
            };

            return View(products.Select(p =>
                $"{nameof(p.Name)}: {p.Name}, {nameof(p.Price)}: {p.Price}"));
        }
    }
}