summaryrefslogtreecommitdiff
path: root/external/aspnetwebstack/src/System.Web.Razor/Utils/EnumUtil.cs
blob: d31c6b7ff3c6ce7de8193bd0daa657ad4abd7a51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.

using System.Collections.Generic;

namespace System.Web.Razor.Utils
{
    internal static class EnumUtil
    {
        public static IEnumerable<T> Single<T>(T item)
        {
            yield return item;
        }

        public static IEnumerable<T> Prepend<T>(T item, IEnumerable<T> enumerable)
        {
            yield return item;
            foreach (T t in enumerable)
            {
                yield return t;
            }
        }
    }
}