-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Automapper OData $expand example | ||
A short project demonstrating how one could use Automapper with $expand and have the result collection include $inlinecount and nextpagequery links. | ||
|
||
# Idea | ||
Automapper includes great support for OData in that you can just do an [EnableQuery] and then ProjectTo<> inside your controller code, and $order, $top, $skip, $select and $filter work out of the box. | ||
|
||
What was missing is the next page link (think HATEOAS), total count and the ability to skip expanding the navigational properties. | ||
By default, Automapper supports .ExplicitExpansion() in the Map, so all we needed to do was add translation from OData $expand to the relevant call of ProjectTo<>. |