breeze

Breeze server-generated keys of guids saving temporary client keys to database

吃可爱长大的小学妹 提交于 2019-12-11 19:19:29
问题 I have set up a breeze app with entities set to autoGeneratedKeyType of Identity . My database uses char(32) guids for primary keys, which are generated as defaults on the PK columns, which are NOT set as identities. Upon save, the record gets created in the database, but it saves with the temporary breeze generated keys of 'undefined-1', 'undefined-2' etc. Can breeze handle this type of server-side key generation scheme? What are my options? I must stick with this key generation approach due

Breeze Local Query for EnumType

一个人想着一个人 提交于 2019-12-11 18:45:30
问题 I setup WebApi method for Lookups which return public Object Lookups() { var durations = Enum.GetNames(typeof(Duration)); var status = Enum.GetNames(typeof(Status)); return new { durations, status }; } Then I make a query to the server with breeze return entityQuery.from('Lookups') .using(manager).execute() .then(querySucceeded, _queryFailed); function querySucceeded(data) { console.log("Retrieving [Lookups] " + data); return true; } Now later on I want to get those lookups from cache, please

AngularJS throws exception when trying to saveChanges with breeze

梦想与她 提交于 2019-12-11 17:40:00
问题 I'm new to AngularJS and Breeze. I'm trying to save changes and have a problem with that. Here's my code: In controller: function update() { vm.loading = true; return datacontext.saveSettings().then(function () { vm.loading = false; // never gets called }).fail(function (data) { vm.loading = false; // never gets called }); } In datacontext: function saveSettings() { if (manager.hasChanges()) { manager.saveChanges() // breaks here if there are changes .then(saveSucceeded) .fail(saveFailed)

Angular and Breeze edit Date object

孤者浪人 提交于 2019-12-11 14:51:55
问题 I have an AngularJS application where I want to edit a Date object that is being exposed by ASP Web API through BreezeJS. When I try to edit this field in a HTML form it doesn't quite work. It seems to edit part of the object, or doesn't bind to the date input type at all. I am wondering what the best way would be to edit Date fields in HTML forms with BreezeJS. I can't find any resources about how one would solve this problem in a proper way. My own guesses would be: Extend the Breeze entity

unable to locate property: Nome on entityType:

痴心易碎 提交于 2019-12-11 14:14:58
问题 Problem unable to locate property: Nome on entityType: Modalidade:#CreditoImobiliarioBB.Model But this property is in the class! No request for /odata/modalidades is generated, only a request for /odata/$metadata . Code Domain class public class Modalidade : INamedEntity { public int Id { get; set; } [StringLength(80), Required] public string Nome { get; set; } } Configurations public static class WebApiConfig { public static void Register(HttpConfiguration config) { var modelBuilder = new

Breeze named saves do not work as expected

时光怂恿深爱的人放手 提交于 2019-12-11 14:02:18
问题 I tried to use the named saves as below and as explained in the release notes here, but it dosen't work and returns: Uncaught Error: The 'entities' parameter is optional or it must be an array where each element must be an entity => breeze.debug.js:724 proto.check => breeze.debug.js:724 proto.saveChanges => breeze.debug.js:11150 sendEmail The function is: var sendEmail = function () { var option = new breeze.SaveOptions({ resourceName: 'sendMail'}) return manager.saveChanges({ saveOptions:

Calling ko.toJS on Breeze entity causes slow long running script

时光怂恿深爱的人放手 提交于 2019-12-11 14:02:16
问题 When calling ko.toJS(entity) on any Breeze entity that has navigation properties or is part of a large object graph IE7-8 complain of long running script errors and even chrome can get bogged down for over 1 second. What gives?!? 回答1: I have had this plague me before and seen various forums or Github issues where this became an issue for devs. I wanted to share some knowledge in hopes that it helps others. The problem Breeze.js provides your client-side libraries or frameworks with an object

When to add extend additional complex types onto a Breeze entity

[亡魂溺海] 提交于 2019-12-11 13:51:43
问题 I want to load an entity from the database, and then using it's ICollection (from the model class) load up some child data. This would be simple enough to do from individual view models if it was a 1 to many relationship, but I have a bit more complex structure - Parent has many children. Each child has many grandchildren, that need to be linked back to the proper child. The hierarchy needs to remain in tact. The other options that I have come up with so far may not be the best way so I my

Breeze working with Web API OData

我怕爱的太早我们不能终老 提交于 2019-12-11 13:35:38
问题 I have a .NET WebAPI 2 Odata service and i am working with Breeze on top of it The OData service is based on the VS2013 ASP.Net VNext version The service supports expand I managed to trick the Microsoft OData metadata serialize to provide the referential constraint with the foreign key like so: <edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0"> <edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="3

EntityFramework Model-First metadata for breezejs

蹲街弑〆低调 提交于 2019-12-11 13:20:19
问题 Breeze.js library requires metadata of the entity context. Web API OData has a default ODataConventionModelBuilder for this operation, but doesn't work for Breeze, since it lacks foreign key information. Thus, Breeze offers a special package called "EdmBuilder" to generate this information. However, it only works with Code-First approach. If there is an existing edmx file, it gives the following exception; Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database