Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:34:23+00:00 2026-06-14T20:34:23+00:00

I am wanting to get the average of a column. I can get it

  • 0

I am wanting to get the average of a column. I can get it working like:

           IEnumerable results = defaultView.Select(args);
           Decimal amount = results.Cast<Fees>().Average(x => x.Fee);

where results is a collection of System.Collections.Generic.List`1 objects. However results is not always the same object because something else may be returned.

It is always in the structure of x objects with 5-10 values each.

I was hoping for a generic way to iterate over the data such as results[0][2] but can’t find a way to access this data without using the strongly typed example above. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:34:24+00:00Added an answer on June 14, 2026 at 8:34 pm

    Your best bet is to create interfaces for the properties that are shared amongst different classes:

    public interface IHasFee
    {
      decimal Fee {get;}
    }
    

    Then you could apply this interface to all the classes that have a Fee property:

    public class Fees : IHasFee
    {
      public decimal Fee {get;set;}
    }
    
    
    public class Charge : IHasFee
    {
      public decimal Fee {get;set;}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wanting to get a WCF-over-TCP service working. I was having some problems with
My table named pictures has a column named pic and I'm wanting to get
I am wanting to get the amount of rows returned when using a INTO
I'm wanting to get some binding working in my mvc application. I find nested
I have a dom structure like so: <a>abc<span>def</span></a> I am wanting to get the
So I'm wanting to get the amount of time that a user has spent
I'm wanting to get the filepath ie /sites/default/files/myfile.pdf for my file uploads. I'm using
I'm wanting to run AJAX to get some URL data, build an object from
I'm wanting a more secure way to store high scores and power ups like
So, I'm wanting to get a better grasp on how string literals in C++

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.