breeze

What is the right way to append entity from one manager to another in breeze?

本秂侑毒 提交于 2019-12-10 12:13:39
问题 What is the right way to append entity from one manager to another? Straight forward attempts result in overwriting entities or in warning about the same entity key... var entity = em1.getEntities()[0]; em1.deattachEntity(entity); // assume em2 already has entities em2.attachEntity(entity); I believe there should be some in-build functionality for appending entries to another non empty manager or for generating an unique key for selected manager. Any suggestions? UPDATE: I did read the

Breeze WebAPI: How to combine QueryResult with ODataQueryOptions to return inlineCount

北城余情 提交于 2019-12-10 11:24:20
问题 I tried different ways of loading a list of items using breeze and the API Controller, using filters (partly using a custom object and another part using ODataQueryOptions), but none of them turn out to be really successful. Test code in javascript: function test() { EntityQuery .from("Products") /* .withParameters({ filters: [ { column: "Name", value: "12" } ]}) */ .orderBy("Name desc") .skip(30) .take(15) .inlineCount(true) .using(manager) .execute() .then(success) .fail(fail); function

Breeze OData error

一世执手 提交于 2019-12-10 10:38:19
问题 I've been trying for some time now to use breeze and OData. My OData comes from another server, and CORS is enabled. I believe the problem is with breeze and odata because I've tested everything using breeze and web api and it worked just fine. In chrome in network tab I see that OData is fetched properly but for some reason data isn't shown and I get this strange error: [Q] Unhandled rejection reasons (should be empty): [Error] q.js:891 Error: OK Logger.js:52 Here is my breeze DataService:

breezejs: getEntityByKey with expand

烈酒焚心 提交于 2019-12-10 10:32:05
问题 Let's say I have a list of Product entities. Then I want to edit one of these products, so I'm going to call getEntityByKey to get it from the cache. However on the edit screen, it is likely that I'm going to display more properties than in the grid, and in my case I actually need to do an expand() on some of the Product properties. So how do I handle that regarding caching ? If I use getEntityByKey, it's not going to do the expand(). I could execute a query, but then I don't take advantage

Missing inverse property in asp.net webapi odata $metadata

一笑奈何 提交于 2019-12-10 10:15:10
问题 have very simple relationship between two entities and I am trying to expose them with asp.net webapi odata controllers but it seems that something is wrong with $metadata. When I run jaydatasvcutil.exe on the $metadata I get warning: inverseProperty other side missing. When I use breezejs loadNavigationProperty I get similar error. I have the problem even with official example. http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/working-with-entity-relations You can observe

Using partials and projections of entities in Web API

﹥>﹥吖頭↗ 提交于 2019-12-10 09:28:02
问题 I am using breeze with Web API. I don't have a good grasp on how to "Filter columns" or how to not expose and entire table to my Web API. I am using the Entity Framework as my source, and both of my questions are addressed by John Papa here: http://www.johnpapa.net/spajs04/#comment-113761 and confirmed to be a good solution by Ward Bell below. Can someone please show me how I to use the entity framework to create a partial or projection that is queryable in my webapi and will work with breeze

Breezejs EntityManager MetadataStore and fetchEntityByKey

馋奶兔 提交于 2019-12-10 05:33:51
问题 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

Breeze doesn't expand more than one navigation property path?

夙愿已清 提交于 2019-12-10 03:09:14
问题 if I run the following query using the NorthindModel, NorthwindDataContext from the breeze samples only the first navigation property is expaned. All other returning null: var query = EntityQuery.from("OrderDetails") .where("OrderID", "==", 11069) .expand("Order.Customer", "Order.Employee"); manager.executeQuery(query).then(querySucceeded).fail(queryFailed); function querySucceeded(data){ var customer = data.results[0].Order().Customer(); var employee = data.results[0].Order().Employee(); //

Why do i have to call NgZone.run for my view to update in Angular2 with breezejs?

混江龙づ霸主 提交于 2019-12-08 17:13:53
问题 I am trying to learn angular2 and created a test application with an odata webapi backend. In the application i have a view which fetches an array of items and i want to show these in my view. For fetching data from the frontend i am using breezejs library since it has proved to save me alot of time in the past and i like using it with an odata backend. The call tree and application structure looks like this: Call starts by calling a service function from the view to start fetching the items

breeze 1.4.8 & angular ajax adapter: how to customize ajax settings?

喜你入骨 提交于 2019-12-08 13:35:31
问题 My code: breeze.config.initializeAdapterInstance("ajax", "angular", true); ... var ajaxAdapter = breeze.config.getAdapterInstance('ajax'); ajaxAdapter.defaultSettings = { method: 'POST', data: { CompanyName: 'Hilo Hattie', ContactName: 'Donald', City: 'Duck', Country: 'USA', Phone: '808-234-5678' } }; in line 14813 of breeze.debug.js: ngConfig = core.extend(compositeConfig, ngConfig); compositeConfig.method has a value of 'POST' until it is overwritten, because ngConfig.method has a value of