breeze

Breezejs SaveChanges: is it possible to return a custom SaveResult object, somehow?

荒凉一梦 提交于 2020-01-06 03:49:27
问题 Say I have a movie entity, with an average score. A user can rate a movie, and for that I call datacontext.savechanges on the client, sending a Rating object to the server. On the server, the SaveChanges method is called, and in the BeforeSaveEntity method, I adapt the movie's average score. Here's the question: how to return that average score from the server's SaveChanges method, for example inside the SaveResult object? I thought I could add the movie entity to the SaveResult Entities list

Breeze ODataException without $expand option

徘徊边缘 提交于 2020-01-05 17:45:15
问题 We are two developers (one with Windows Server 2008 R2 and the other with Windows 8) that working on same project (on TFS with Visual Studio 2013 and with the last nuget packages like Breeze 1.4.11 installed), but with different results on breeze query execution. With Windows Server 2008 R2 we must add $expand option otherwise we have an error Only properties specified in $expand can be traversed in $select query options , conversely with Windows 8 the query run successfully without $expand

Dynamic select element filtering in Angular

浪子不回头ぞ 提交于 2020-01-05 08:25:07
问题 I am using an ng-repeat to iterate over objects for displaying in Angular and each of these objects contains a select element containing a property of the object. I want to filter options based off the selected value for each of the objects' other properties (whew, this is harder to explain than I thought) but the problem is that these are Breeze entities and if I use the traditional method Angular provides the stack throws an overflow exception due to the cyclic nature of Breeze entities. I

how to make the breezejs required validator allow empty strings

℡╲_俬逩灬. 提交于 2020-01-04 19:55:33
问题 What is the preferred way in breezejs to allow empty strings in required properties? I found this answer which recommends replacing the required validator like this: Validator.required = function (context) { var valFn = function (v, ctx) { return v != null; } return new Validator("required", valFn, context); }; // register the new validator so that metadata can find it. Validator.registerFactory(Validator.required, "required"); There's also mention of a allowEmptyStrings flag somewhere. What

Durandal Modal Won't Close

前提是你 提交于 2020-01-04 06:36:26
问题 Modals are turning out to be more difficult than I thought :/ Got the modal loading up a view / view modal properly, clicking the save button saves the information (I do get a 'Should be Empty : []' from Q.js but apparently this isn't a problem?) the problem I am having is probably related to promises but if it is I can't find it. Parent's view model - var createNew = function () { app.showModal(tfcreate).then(function (modalResult) { if (!modalResult) { return false; } var templateId =

What is the state of BreezeJS integration with express and mongo DB?

独自空忆成欢 提交于 2020-01-04 06:04:08
问题 I have forked BreezeJS and I have the EpressDemo running, the server is working and is connecting to Mongo. Though the DB is empty ( if anyone could tell me how to setup the initial data... ) the Metadata is set and Breeze is accessing it from the client. Now I understand that breeze is capable of keeping track of all the changes on the client but can I save them back to Mongo DB ? is there a Lib to install in the express app to save the dataBundle to mongodb ? or do I need to create my own

Breeze.js: adding an element to a navigation property collection without inverse rel raises an exception [Unable to get value of the property 'name']

萝らか妹 提交于 2020-01-04 02:36:45
问题 I have two entities in my EDM, Application and Address pretty much like the following: class Application { ICollection<Address> Addresses { get; set; } } class Address { } On the client, I create an instance of each and try to add the address instance to the Application.addresses collection: var address = addressType.createEntity(...); var application = applicationType.createEntity(...); application.addresses.push(address); Unfortunately, I get a runtime exception saying: " Unable to get

Validation in Breeze and Knockout

拜拜、爱过 提交于 2020-01-03 08:41:36
问题 I've recently added Breeze to a project using Knockout and ASP.NET MVC4. I really like Breeze and it saves a lot of coding. I have used Knockout validation and like how it validates a property field text box on data entry and the way the error message is displayed. I would like to use a combination where the validation requirements are defined in the back-end with C# attributes on the object properties, the validation requirements are received in the metadata and then Knockout validation can

angular-ui-select2 and breezejs: load ajax list after typing in 2 characters

江枫思渺然 提交于 2020-01-02 11:44:07
问题 I have a project where I'm using BreezeJS to fetch data from my webserver. I'm using AngularJS with the ui-select2 module. Currently, I have it where when I load my page, breezejs makes a call to fetch the data that I dump into a scope variable. From there, select2 can easily make the reference to it and build accordingly. If I want to ajaxify things, it gets really tricky. I want to have the ability to use select2's ajax or query support, but instead of using it to fetch data, I want to use

Error with breeze when deleting an entity which contains child entities

百般思念 提交于 2020-01-02 07:23:08
问题 I work on a project with Entity Framework Code First + Durandal + Breeze. I have these entities models: public class Packing { [Key] public int Id { get; set; } public string PackingDescription { get; set; } ... public virtual List<Isotope> Isotopes { get; set; } public virtual List<PhysicalForm> PhysicalForms { get; set; } public virtual List<ChemicalForm> ChemicalForms { get; set; } } public class Isotope { [Key] public int Id { get; set; } public string Name { get; set; } ... public int