In my OdataController I am exposing entity Customer (as an example). I have a method:
Get()
This works just fine. To return a single entity I have this method:
GetCustomer(int key)
This also works just fine.
* So here's my Question*
Is GetCustomer the only signature option to return a single entity? I'm not sure how ODataController knows how to resolve this method signature, but Im wondering if there is a generic way to define this.
GetCustomer by default would get a Customer.Customer navigation property. Now you will save a question on stackoverflow ;) Top get a single entity you can just use Get(int/string key) as follows:
Assume db is your db context instance
Hope it helps.