I have these classes Task and ResourceHour
A list of Task objects is bound to a RadGridView and I want to create a custom aggregate on Property "TotalHoursByResource" which is a list of ResourceHour objects.
When i try to do it as below, it gives an error
No generic method '' on type '' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
Any ideas if I can create a custom aggregate function to run on a property which itself is a list??
public
class
Task {
public
Task() {
this
.TotalHoursByResource =
new
List<ResourceHour>();
}
public
int
ID {
get
;
set
;}
public
string
Name {
get
;
set
; }
public
decimal
TotalHours {
get
;
set
; }
public
List<ResourceHour> TotalHoursByResource {
get
;
set
; }
}
public
class
ResourceHour {
public
string
Resource {
get
;
set
; }
public
string
WorkingHourType {
get
;
set
; }
public
double
Hours {
get
;
set
; }
}
A list of Task objects is bound to a RadGridView and I want to create a custom aggregate on Property "TotalHoursByResource" which is a list of ResourceHour objects.
When i try to do it as below, it gives an error
No generic method '' on type '' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
public
class
HoursAggregate : EnumerableSelectorAggregateFunction {
protected
override
string
AggregateMethodName {
get
{
return
"GetAggregateHours"
; }
}
protected
override
Type ExtensionMethodsType {
get
{
return
typeof
(HoursAggregateType); }
}
}
public
static
class
HoursAggregateType {
public
static
string
GetAggregateHours<T>(IEnumerable<Task> source, Func<Task, List<ResourceHour>> selector) where T : Task {
return
"Some string from TotalHoursByResource"
;
}
}
Any ideas if I can create a custom aggregate function to run on a property which itself is a list??