Q:

Breezejs EntityManager MetadataStore and fetchEntityByKey

I have a SPA application (durandaljs), and I have a specific route where I map the "id" of the entity that I want to fetch.  
The template is "/#/todoDetail/:id".  
For example, "/#/todoDetail/232" or "/#/todoDetail/19".  
On the activate function of viewmodel, I get the route info so I can grab the id. Then I create a new instance of breezejs EntityManager to get the entity with the given id. 
The problem is when I call manager.fetchEntityByKey("Todos", id), the EntityManager doesn't have yet the metadata from the server, so it throwing exception "Unable to locate an 'Type' by the name: Todos".  
It only works if first I execute a query against the store (manager.executeQuery), prior to calling fetchEntityByKey.  
Is this an expected behavior or a bug ?  Is there any way to auto-fecth the metadata during instantiation of EntityManager ?  
note: I believe it's hard to use a shared EntityManager in my case, because I want to allow the user directly type the route on the browser. 
EDIT: As a temporary workaround, I'm doing this:
BreezeService.prototype.get = function (id, callback) {
    var self = this;

    function queryFailed(error) {
        app.showMessage(error.message);
        callback({});
    }

    /* first checking if metadatastore was already loaded */

    if (self.manager.metadataStore.isEmpty()) {
        return self.manager.fetchMetadata()
        .then(function (rawMetadata) {
            return executeQuery();
        }).fail(queryFailed);
    } else {
        return executeQuery();
    }

    /* Now I can fetch */
    function executeQuery() {
        return self.manager.fetchEntityByKey(self.entityType, id, true)
                        .then(callback)
                        .fail(queryFailed);
    }
};

A:

You've learned about fetchMetadata.  That's important.  If you application can begin without issuing a query, you have to use fetchMetadata and wait for it to return before you can perform any operations directly on the cache (e.g., checking for an entity by key in the cache before falling back to a database query). 
But I sense something else going on because you mentioned multiple managers.  By default a new manager doesn't know the metadata from any other manager.  But did you know that you can share a single metadataStore among managers?  You can. 
What I often do (and you'll see it in the metadata tests in the DocCode sample), is get a metadataStore for the application, write an EntityManager factory function that creates new managers with that metadataStore, and then use the factory whenever I'm making new managers ... as you seem to be doing when you spin up a ViewModel to review the TodoDetail.