0
votes

I have had a short look at the Breeze-package.. and it seems very promising.. but the thing I dont get is.. which actions are required for the breezejs-framework(the client one) to work properly?.. Since in the example there are two actions which Im not sure of what they are doing.. or if they some how config the client-framework..

The two actions are: Metadata and SaveChanges.. I do understand what they do... but as I mentioned.. first of all.. are they required for the Breeze-clientside-framework to function?..Could I change the name of SaveChanges for instance? and 2:ndly.. How does the SaveChanges work?.. is it simply "fetching" any object/entity you thorw at it..and then preform a check against the server-entity-models and if there is any match, then it save the data?.. is it also doing an update and/or a create of entities?..

Thanks in advance!

1

1 Answers

0
votes

Breeze uses the server side Metadata action to return metadata about the shape of the objects that it will be managing. This same metadata can also be defined on the client side directly and Breeze can be told not to try to get metadata from the server ( see the DataService.hasServerMetadata) property. By default, if this is not set, i.e if breeze does not yet have metadata about a service, then it will automatically try to get the metadata from the server before its first "query" against that service. The NoDb sample in the breeze zip shows a good example of skipping this and providing the metadata directly on the breeze client.

The server side SaveChanges action is only needed if you want to persist data from the breeze client back to the server via the client side "SaveChanges" call. The NoDb sample mentioned above shows an example of this as well.

Out of the box, breeze ships with a server side implementation of both Metadata and SaveChanges for Entity Framework backed models, but you can also supply your own version of either. We are also working to produce other out of the box implementations for other popular backends (Raven, Mongo etc).