I am going to comment mainly on the CORS question of your question. The part about $ expand and $ select is discussed in fooobar.com/questions/1489046 / .... In short, [Queryable] is a web API attribute that does not support $ expand and $ select. I think you need the [BreezeQueryable] attribute.
I canβt say for sure, but I donβt believe that the code you are showing is the right way to implement CORS for the web API. At least I have not seen this.
I know two ways; both include the addition of message handlers.
First, we did this in the Breeze Todo example; the second is CORS web API support, which is in transit.
The way we did this is simplified but effective. We are not talking about this because we intend to defer it to an approved web API when it arrives (I hope soon).
In the demo demo, find App_Start / BreezeSimpleCorsHandler.cs . You can simply copy it to your own App_Start folder without changes, except for the namespace.
Then your server should call it. In the Todo sample, we did this in BreezeWebApiConfig.cs, but you can put it in Global.asax or in anything that is part of the server load logic.
// CORS enabled on this server
GlobalConfiguration.Configuration.MessageHandlers.Add (new BreezeSimpleCorsHandler ());
As it happens, someone tried Breeze with the upcoming CORS NuGet API package ... and found an error in Breeze. We must work to ... and we will do it. We really want this to be the way to go.
Until then, you can follow the Todo sample pattern.
source share