Can I use an anonymous type as a return type in a Function, and then stuff that returned value into an array or collection of some sort whilst also adding an additional fiel
No, you can't return an anonymous type directly, but you can return it using an impromptu interface. Something like this:
public interface IMyInterface
{
string GroupName { get; }
int RowSpan { get; }
}
private IEnumerable GetRowGroups()
{
var list =
from item in table
select new
{
GroupName = groupedTable.Key.column1,
RowSpan = groupedTable.Count()
}
.ActLike();
return list;
}