I’m experimenting with Breeze as I’m rewriting a legacy Web Forms app as a SPA using MVC and Web API.
I’m using EF6 and it’s clear Breeze is going to cut out an awful lot of work writing JavaScript model classes, mapping code and data contexts on the client, not to mention filters and projections. I’m going to post a quick guide to setting up Breeze with EF6 ( mainly for myself ) later. I noticed I’m getting 404s on the metadata service Breeze calls if I stop the app in debug mode and then re run.
This Stackoverflow answer appears to have solved this issue.
http://stackoverflow.com/questions/15715701/metadata-query-failed-for-breeze-js
.. Relative URLS seem work just as well. See the url passed to the breeze.DataService object below.
define('app/vm.accounts', [ 'ko', 'breeze', 'app/config' ], function (ko, breeze, config) { var accounts = ko.observableArray([]) , dataService = new breeze.DataService({ serviceName: "/api/licensing/" , hasServerMetadata: false }) , em = new breeze.EntityManager({ dataService:dataService }) , currentAccount = ko.observable() , logger = config.logger , getAccounts = function() { var query = breeze.EntityQuery.from("Accounts") em.executeQuery(query) .then(function(data) { accounts(data.results); }) .fail(errorLoading); } , errorLoading = function(error) { logger.error(error.message, "Loading failed"); }; return { accounts: accounts, }; });