Attribute: [Avg], [Count], [First], [Last], [Max], [Min] and [Sum]
Posted by Gerhard Stephan on March 7th, 2008
This aggregation attributes can be placed on any projection property of a projection class.
public class TimeEntryAggregation
{
private DateTime minDate;
/// <summary>
/// Gets or sets the min date.
/// </summary>
/// <value>The first date.</value>
[ProjectOntoProperty(typeof(TimeEntry), "StartDate")]
[Min]
public DateTime MinDate
{
get { return minDate; }
set { minDate = value; }
}
}
var minTimeEntry = mapper.Load(typeof(TimeEntryAggregation), null as ICondition) as TimeEntryAggregation;
The following attributes can be used this way:
- [Avg]
- [Count]
- [First], [Last]
- [Min], [Max]
- [Sum]
