MVC3 query clause custom query
===


First Table
    
+--------+------------+-------+

| type| variety    | price |

+--------+------------+-------+

| apple  | gala       |  2.79 | 

| apple  | fuji       |  0.24 | 

| apple  | limbertwig |  2.87 | 

| orange | valencia   |  3.59 | 

| orange | navel      |  9.36 | 

| pear   | bradford   |  6.05 | 

| pear   | bartlett   |  2.14 | 

| cherry | bing       |  2.55 | 

| cherry | chelan     |  6.33 | 

+--------+------------+-------+



Second Table --------------------------------------------------------

select type, min(price) as minprice

from fruits

group by type;

+--------+----------+

| type   | minprice |

+--------+----------+

| apple  |     0.24 | 

| cherry |     2.55 | 

| orange |     3.59 | 

| pear   |     2.14 | 

+--------+----------+


Hello there,

sorry for how the table display... not allow to post images. 

First table is a example of a table, not exactly the table i am working on. I can't display the data/tablefields here. 

Second table that's what i want from the first table. 

I am using GenericRepository/ UnitOfwork to get the data from repository. 

I try to do this:

repository.fruitRepository.Get().GroupBy(m => m.type);

but i only get the type field. what do i have to do to get more fields.

do i have to use .Select() clause before .GroupBy clause if yes how do i set up .select() for multiple fields. 


Thanks.
If more information needed let me know. 


