Well, I've found one way of doing it, without any specific support from breeze, just WebApi routing.
I just basically changed the controller route to the following:
GlobalConfiguration.Configuration.Routes.MapHttpRoute(
name: "BreezeApi",
routeTemplate: "breeze/{appVersion}/{controller}/{action}"
);
And then when creating the EntityManager
, I do it as follows:
var manager = new breeze.EntityManager('breeze/' + appVersion + '/data');
Where appVersion
has the incremental numeric version value.
This lets you later configure caching for the Metadata action, such as:
[HttpGet]
[CacheOutput(ClientTimeSpan = CLIENT_DURATION, ServerTimeSpan = SERVER_DURATION)]
public string Metadata()
{
return _contextProvider.Metadata();
}
I'll leave the question open in case someone has a cleaner solution, or one implemented by breeze internally.