mirror of
https://github.com/rudollee/LearningMVC.git
synced 2025-06-07 07:56:14 +00:00
20 lines
370 B
C#
20 lines
370 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace LanguageFeatures.Models
|
|
{
|
|
public static class MyExtensionMethods
|
|
{
|
|
public static decimal TotalPrices(this IEnumerable<Product> productEnum)
|
|
{
|
|
decimal total = 0;
|
|
foreach (Product prod in productEnum)
|
|
{
|
|
total += prod.Price;
|
|
}
|
|
return total;
|
|
}
|
|
}
|
|
} |