MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

SaveAs support groupby collection merge cell expand

Open shps951023 opened this issue 4 years ago • 5 comments

TestIssue165.xlsx image image

shps951023 avatar Apr 12 '21 01:04 shps951023

public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
{
	return new GroupedEnumerable<TSource, TKey>(source, keySelector, null);
}

public interface IGrouping<out TKey, out TElement> : IEnumerable<TElement>, IEnumerable
{
	TKey Key
	{
		get;
	}
}

using System.Collections.Generic;

public GroupedEnumerable(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
{
	if (source == null)
	{
		ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
	}
	if (keySelector == null)
	{
		ThrowHelper.ThrowArgumentNullException(ExceptionArgument.keySelector);
	}
	_source = source;
	_keySelector = keySelector;
	_comparer = comparer;
}

shps951023 avatar May 31 '21 05:05 shps951023

S.O : https://stackoverflow.com/questions/67768530/how-to-check-object-variable-is-linq-group?noredirect=1#comment119784177_67768530

c# - LINQ Grouping dynamically - Stack Overflow

shps951023 avatar May 31 '21 06:05 shps951023

image

shps951023 avatar May 31 '21 07:05 shps951023

By Attribute option image image

shps951023 avatar Jul 02 '21 07:07 shps951023

image

shps951023 avatar Jul 02 '21 07:07 shps951023