AdFactum ObjectMapper .NET Blog

Official blog of the AdFactum ObjectMapper .NET

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]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>