packages/System.Linq.Dynamic.Core.1.0.7.9/src/System.Linq.Dynamic.Core/GroupResult.cs

(完整代码) 1KB

using System.Collections;
using System.Collections.Generic;
using System.Globalization;

namespace System.Linq.Dynamic.Core
{
    /// <summary>
    /// The result of a call to a <see cref="DynamicQueryableExtensions"/>.GroupByMany() overload.
    /// </summary>
    public class GroupResult
    {
        /// <summary>
        /// The key value of the group.
        /// </summary>
#if NET35 || SILVERLIGHT
        public object Key { get; internal set; }
#else
        public dynamic Key { get; internal set; }
#endif

        /// <summary>
        /// The number of resulting elements in the group.
        /// </summary>
        public int Count { get; internal set; }

        /// <summary>
        /// The resulting elements in the group.
        /// </summary>
        public IEnumerable Items { get; internal set; }

        /// <summary>
        /// The resulting subgroups in the group.
        /// </summary>
        public IEnumerable<GroupResult> Subgroups { get; internal set; }

        /// <summary>
        /// Returns a <see cref="System.String" /> showing the key of the group and the number of items in the group.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", ((object)Key).ToString(), Count);
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。