michaelp0730
3/29/2017 - 6:01 PM

Static Helper Method

An example of making a static helper method. In this case we accept an IEnumberable of Geo objects and return those whose value of IsHealthHidden is false.

using System.Collections.Generic;
using System.Linq;
using Acom.Entities;

namespace ACOM.Web.Helpers
{
    public static class GeosHelper
    {
        public static IEnumerable<Geo> ShowGeoHealth(this IEnumerable<Geo> geos)
        {
            return geos.Where(geo => !geo.IsHealthHidden);
        }
    }
}