The Breeze documentation says:
This [MetadataStore.FetchMetadata] call is made automatically by Breeze just before it attempts to perform it's first query against a remote service
But I am making a call like this:
function getBags() {
var bags;
var query = breeze.EntityQuery.from('Bags');
return manager.executeQuery(query).then(querySucceded, _queryFailed);
function querySucceded(data) {
bags = data.result;
logSuccess("Retrieved Bag Data")
return bags;
}
}
function _queryFailed(error) {
logError(config.appErrorPrefix + "Query Failed: " + error.message);
throw error;
}
When I do this I get this error:
"Unable to locate a 'Type' by the name: 'Bag:#DataAccess'. Be sure to execute a query or call fetchMetadata first."
as the value of error.message
in _queryFailed
.
NOTE: I know it is connecting to my OData service, because if I put in random stuff for my query I get a resource not found:
Resource not found for the segment 'Bagsasdfas'.;
I am using the HotTowel.Angular and HotTowel.Angular.Breeze nuget packages. The only difference is that I am connecting directly to a WCF Data Service (OData).
I do have these calls before I call the query:
breeze.config.initializeAdapterInstances({ dataService: "OData" });
breeze.config.initializeAdapterInstance("modelLibrary", "backingStore", true);
Anyone got an idea why Breeze would not go get the metadata automatically for this?