Reputation: 171
So I am making a page that has a table that lets you choose a database table and columns that you want to see, then constructs a breeze EntityQuery and executes that query, then knockout to bind it to the table. This works when I have already made a call out the the database, however, when this page is the first page that I hit on the web app, there is no information in the metadata.
Is there some function I can call on application start that will call my breeze api and map the metadata without actually calling for one of the entities first?
Upvotes: 0
Views: 72
Reputation: 116
Yes you can make a call to fetchMetadata() on your manager which returns a promise.
entitymanager.fetchMetadata().then(function() { do something
}
You can store this metadata and create managers using
entitymanager.createEmptyCopy();
There are several examples of wrapping this functionality in a context within the breeze samples. Hope this helps!
Upvotes: 1