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 554783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:44:48+00:00 2026-05-13T11:44:48+00:00

LINQ-newb having trouble using grouping. I’m trying to query an IEnumerable called dosesWithHighestScore. I’m

  • 0

LINQ-newb having trouble using grouping. I’m trying to query an IEnumerable called dosesWithHighestScore.

I’m following this example:
http://msdn.microsoft.com/en-us/vcsharp/aa336747.aspx#minGrouped

Here’s my code:

    var doseWithLowestVolumeForForm =
        from d in dosesWithHighestScore
        group d by d.formulation.form into g                
        select new { 
            Form = g.Key, 
            LowDose = g.Group.Min(d => d.doseAdministrableAmount)
        };

The use of “Group” is causing this error:

‘System.Linq.IGrouping’ does not contain a definition for ‘Group’ and no extension method ‘Group’ accepting a first argument of type ‘System.Linq.IGrouping’ could be found (are you missing a using directive or an assembly reference?)

Here are my usings:

using System;
using System.Text;
using System.Linq;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Collections;

Why am I getting this error?

  • 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-05-13T11:44:49+00:00Added an answer on May 13, 2026 at 11:44 am

    You an get rid of the Group term in your assignment to LowDose. In LINQ-to-objects, a group is itself an IEnumerable<>, so you can apply other LINQ operations to it without any additional qualifiers. The Key property is provided on IGrouping so that you can access the value by which the group was … well, grouped.

    var doseWithLowestVolumeForForm =
            from d in dosesWithHighestScore
            group d by d.formulation.form into g                
            select new { 
                Form = g.Key, 
                LowDose = g.Min(d => d.doseAdministrableAmount)
            };
    

    The examples on the site that show the use of a Group property are incorrect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to serialize some Linq objects using this code. private byte[] GetSerializedObj(object
My linq query returns a collection of IEnumerable<object> . How can I convert this
Using LINQ on collections, what is the difference between the following lines of code?
I am new to LINQ and am trying to sort this one out. I
Linq allows you to create new object inside of a query expression. This is
I am trying to query some informations from xml with linq but I am
linq only supports inner join, how to do left join using linq query. also
I have the following code using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace
Linq and EF4. I have this Linq query in query syntax I would like
LINQ drives me crazy. Why does following query not return the duplicates, whereas it

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.