Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linq Blues
Message
From
04/04/2017 15:01:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
C#
Category:
LINQ
Title:
Miscellaneous
Thread ID:
01649772
Message ID:
01649778
Views:
53
This message has been marked as a message which has helped to the initial question of the thread.
>Does this not work because I need to Groupby GoodsType.Description and TransactionType.Descriptiion and both have the same name.
>Is there a away around this?
>Or ... is this why you should always prefix your field names? :(
>
>
>                var pBI = context.TransactionDetails.
>                    GroupBy(t => new { t.Parcel.GoodsType.Description, t.TransactionHeader.TransactionType.Description }, (key, g) =>
>                    new
>                    {
>                        Transaction = key.Description,
>                        Goods = key.Description,
>                        Weight = g.Select(t => t.Weight),
>                        Amount = g.Select(x => x.Amount)
>                    });
>
var pBI = context.TransactionDetails.
					GroupBy(t => new { 
					parcelDescription = t.Parcel.GoodsType.Description, 
					transactionDescription = t.TransactionHeader.TransactionType.Description 
					}, (key, g) =>
					new
					{
						Transaction = key.parcelDescription,
						Goods = key.transactionDescription,
						Weight = g.Select(t => t.Weight),
						Amount = g.Select(x => x.Amount)
					});
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform