breeze

saving changes to breeze web api from c#

核能气质少年 提交于 2019-12-24 01:48:08
问题 I want to create a c# application that will use the breeze web api to save change set to the server using the same SaveChanges(JObject saveBundle) action. How can I serialize and represent the changeset to be sent to the server. My primary question is how breezejs serializes the changeset when it sends it to the server. Cant we do the same with c# and for example JSON.NET 回答1: As of later today - we are releasing a beta of a sister product to Breeze.Js called Breeze.Sharp. This is a .NET

Breeze: EFContextProvider/Breeze Controller and Service Layer

独自空忆成欢 提交于 2019-12-24 01:27:57
问题 When using Breeze, I was wondering how one would go about integrating it with a service layer which handles things such as email notifications, audit logs, business validations (ie Customer must exist) etc.. For example, given the following scenario: public class SalesAppRepository { private readonly EFContextProvider<SalesAppContext> _contextProvider; public SalesAppRepository(EFContextProvider<SalesAppContext> contextProvider) { _contextProvider = contextProvider; } private SalesAppContext

Why does the Breeze Web API implementation respond to metadata requests with a string instead of a JSON object?

霸气de小男生 提交于 2019-12-24 00:36:47
问题 Is there any reason that the Breeze Web API implementation of the response to any metadata requests returns a string instead of a JSON object? Sending metadata as text adds a lot of overhead over the network (due " encoding) and on clientside due manual JSON.parse. I think that your controller can simply return the Metadata as JSON by specifying the contentType header: i.e. [HttpGet] public HttpResponseMessage Metadata() { var result = new HttpResponseMessage { Content = new StringContent(

Breeze - expand results in Object #<Object> has no method 'getProperty' Query failed

余生长醉 提交于 2019-12-23 20:54:15
问题 In my edmx model are 2 related tables: Challenge and ChallengeNote (has FK back to ChallengeID) I can do this in breeze all day long var qry = dataservice.getQuery("Challenges"); However, this fails every time: var qry = dataservice.getQuery("Challenges").expand("ChallengeNotes"); The searchFailed is called and is the only error information in the console. return dataservice.execute(qry.inlineCount(true)) .then(seachSucceeded) .fail(searchFailed); Does Breeze support relational data like this

Breeze query error, even though results returned

时光毁灭记忆、已成空白 提交于 2019-12-23 17:36:03
问题 Breeze is calling the "fail()" function, even though the data seems to be returned from the odata service (as well as being in the error object). There are 5 "transactions" returned from the ODATA service (as seen in Chrome developer tools) as well as in the "data" property of the error object being passed to the fail function. Calling code looks like this: function getTransactions() { var query = breeze.EntityQuery.from("Transactions") .take(5); return entityManager.executeQuery(query,

How will I use breeze with Entity Framework 6 with .net 4.0

谁说胖子不能爱 提交于 2019-12-23 13:58:15
问题 I installed my 4.0 MVC project, Entity Framework 6 using nuget(to enable ode first migrations). Then I tried installing breeze package Breeze.Server.ContextProvider.EF6. But I'm having missing assembly reference errors for breeze. 回答1: The only way I was able to get Breeze working on .NET 4.0 with Entity Framework 6 was to create my own EF6ContextProvider using the Breeze source code from GitHub as a starting point. I created a project Breeze.WebApi.EF6 and added a class EF6ContextProvider.cs

Breeze using angular $http interceptor

China☆狼群 提交于 2019-12-23 10:00:21
问题 I use a angular $http interceptor, to check if a ajax request returns 401 (not authenticated). If response is 401, the original request gets queued, a login form is shown and after login successfully, it retries the queued requests. This already works with $http, and the source for the angular interceptor is: define('common.service.security.interceptor', ['angular'], function() { 'use strict'; angular.module('common.service.security.interceptor', ['common.service.security.retryQueue'])

Calling rejectChanges on a entity with collection of complexTypes doubles the complexTypes in collection

余生颓废 提交于 2019-12-23 05:15:38
问题 This may be something I am doing wrong, but I am having an issue that I believe is repeatable. It may be by design, but right now I can't figure out how to get around it. I have an entity with a few complexType arrays on them. If I push a new complexType into the array, I see the correct number of objects in the collection. If I call rejectChanges on the parent entity, it removes the new complexType but then copies all of the objects in that array. Sample metadata - metadataStore

Consuming Web API 2 OData endpoint requiring Windows Authentication with BreezeJS

我怕爱的太早我们不能终老 提交于 2019-12-23 04:45:22
问题 Has anyone have experience getting Breeze (or DataJS for that matter) to communicate with a Web API 2 OData endpoint which requires Windows Authentication and is hosted on a different server? I have successfully configured Web API to enable CORS and I am able to initiate a cross-domain request to the OData endpoint using jQuery: load: function () { $.ajax({ type: "GET", dataType: 'json', url: "http://services.company.com/odata/GeographicalRegions", xhrFields: { withCredentials: true },

Breeze expand query fails with Object #<Object> has no method 'getProperty'

只愿长相守 提交于 2019-12-23 04:03:38
问题 I'm using Breeze 1.4.2 with Entity framework 5. This is my query: var query = breeze.EntityQuery .from("TrendStudies") .where("Id", "==", studyId) .expand("Charts"); This works fine if I remove the .expand -part, but otherwise it fails with the following error message: Object #<Object> has no method 'getProperty' Apparently this error is thrown from the breeze function: function updateRelatedEntityInCollection(relatedEntity, relatedEntities, targetEntity, inverseProperty) { if (!relatedEntity