I need to set a relation between classes:
First class is a Route . Route has StartStation (Station class), and EndStation (Station class).
And every station could be start or end station for many routes.
Is it one-to-many relation?
If yes, how can I set that relation?
Giving EntitySet<Route> on the Station class makes no sense for me, but maybe I’m wrong?
I would guess that a single
Stationinstance is reached by NRouteinstances, so theStation–Routerelationship is one to many.StartStationandEndStationwould be roles thatStationis playing in different routes. Each route has a start station and an end station, so the relationship would look something like this:In such a way, I would advise that you set properties
StartStationandEndStationas you just did, and having anEntitySet<Route>for eachStationdoes actually make sense: is the collection of all routes that are related with thatStationinstance.