1
0
mirror of https://github.com/rudollee/LearningMVC.git synced 2025-06-07 16:06:21 +00:00
This commit is contained in:
wook 2017-04-03 03:04:41 +09:00
parent 496c391fd0
commit 58d04197ee

View File

@ -143,5 +143,22 @@ namespace LanguageFeatures.Controllers
return View("Result", (object)result.ToString());
}
public ViewResult SumProducts()
{
Product[] products =
{
new Product {Name = "Kayak", Category = "Watersports", Price = 275M },
new Product {Name = "Lifejacket", Category = "Watersports", Price = 48.95M},
new Product {Name = "Soccer ball", Category = "Soccer", Price = 19.50M },
new Product {Name = "Coner flag", Category = "Soccer", Price = 34.95M }
};
var results = products.Sum(e => e.Price);
products[2] = new Product { Name = "Stadium", Price = 7950M };
return View("Result", (object)String.Format("Sum: {0:c}", results));
}
}
}