c# - Entity Framework 6 - GroupBy on navigation properties -
I am working with unit framework 6 (EF 6) and the following model is:
public class engine {public entry ID (get; set;} public string name {get; set;} public virtual icon & lt; car & gt; cars ; Set;}} public class car {public entry id (get; set;} public string name {get} set;} public virtual Public engine purchase {get; set;}} public class purchase {public entry ID (get; set;} public date time created (get; set;) public virtual icon & (1-to- Many-relationships) purchase> (1-to-many-relationship) How to fix it Which engine is most likely to be Ride have? I need a sorted list of engines (descending) and was often bought them.
I have some problems with navigation-properties and how to integrate the group.
Thanks
Try it out:
Return (from this in the car) Context Car where car Purchase! = Faucet group car by car. Select genes in the new new {engine name = g. Of Name, calculation salted = g.count ()}). Order by dicing (x = & gt; x.CountSold). to list(); Also, please take a look.
Comments
Post a Comment