breeze

Working with beforeSaveEntity and Navigation Properties

一个人想着一个人 提交于 2019-11-29 15:43:53
My application allows the user to create products along with their UOM (Units of Measurement) and Barcodes During the creation process, API will check if there is no barcode entered, it will generate it automatically. That worked fine until I decided to add weight products that require scale barcodes with 7 digits. BeforeSaveEntity will ask if the product type is weight then generate 7 digits barcode, else, it will generate 13 digits. The problem is; I can't get this to work when checking the parent table, here is my code: Models: (for convenience, I have omitted unneeded properties.) public

How can I detect a change to an entity's EntityState?

蓝咒 提交于 2019-11-29 13:59:55
问题 I want to put a "Delete" button and a "Cancel" button on each row of a list of Customers. The "Cancel" button is disabled when a customer is "Unchanged". But when a customer transitions to a changed state ("Added", "Modified", "Deleted"), I want to enable the "Cancel" button so the user can reverse the changes -- whatever they are -- before saving. I can almost do this by subscribing to customer.entityAspect.propertyChanged . A property change signals a potential change in the EntityState . I

KO.Computed equivalent in Angular / Breeze Initializer

回眸只為那壹抹淺笑 提交于 2019-11-29 06:39:22
问题 Trying to get a more in-depth understanding of how Angular treats data binding and understanding it better and one thing is difficult to get my head around - In Knockout I use a computed to keep track of changes to a property. In Angular it to move this logic into the view, which is a it trivial to me, but if that is the way to do it I understand. My question is when I am initializing a new entity with Breeze/Angular how do I create computed-like properties that are notified when changes

Spin icon freezes while loading records

拈花ヽ惹草 提交于 2019-11-29 06:23:24
I am trying to load records using breeze. While loading record i am showing spin icon. But somehow spin icon seems to stop while records are being loaded in grid. Here is my html <div id="showSpin" data-bind="visible: isSpinning" style="padding: 10px; position: absolute; top:248px;left: 320px; background-color: #FFF; opacity: 0.9; filter: alpha(opacity=90);"> <img src="/images/spin.gif" /> </div> here is my code to load image isSpinning(true) context.getData(name, records).then(function (data) { isSpinning(false); setTimeout(function () { isSpinning(false); }, 300); }) .fail("Record not found"

Current status of Upshot.js

被刻印的时光 ゝ 提交于 2019-11-29 03:07:11
I am thinking of using upshot.js along with Knockout in one of my very important projects. I do not see any documentation or any activity around upshot. Before I commit to this decision, is this project still active? If the entire asp.net stack is now open and one can see what is getting committed to repository, why this small library is still not on codeplex or github for community to see? I hope this is still on radar of asp.net team. According to this blog post, Upshot is officially dead: http://www.riaservicesblog.net/Blog/post/WCF-RIA-Services-is-Dead-Long-Live-WCF-RIA-Services.aspx The

Ignore a property from a code first generated entity

家住魔仙堡 提交于 2019-11-28 12:17:18
Is there a .Net attribute that will tell Breeze to completely ignore a property? I know that making the property protected is one way to hide it from Breeze and prevent its serialization, but what if I would like it to remain public ? It is tricky to devise an easy, maintainable way to have EF-generated metadata say one thing to the client and another to EF itself. But you can do it if you're willing to have two DbContexts : the "real" DbContext for server-side model operations and another DbContext strictly for client metadata generation. A DbContext for Metadata It isn't as difficult as it

How should I create secondary DbContext using ContextProvider.EntityConnection?

别说谁变了你拦得住时间么 提交于 2019-11-28 10:50:43
问题 I'm using breeze with Code First EF. My production DbContext has IDatabaseInitializer that throws an exception if !context.Database.CompatibleWithModel(true) . If I create a context like suggested in the documentation database compatibility cannot be checked. // The following line will throw NotSupportedException. // Unable to verify the compatibility of the model because // the DbContext instance was not created using Code First patterns. var context2 = new MyDbContext(EntityConnection,

from jQuery-ajax to breeze.js (SharePoint ODATA example)

╄→尐↘猪︶ㄣ 提交于 2019-11-28 10:37:25
问题 I am starting to use breeze.js for my ODATA service. I am using a SharePoint ODATA api and i have an example of how to use it with jQuery-Ajax. To make this work with breeze would be so f-ing awesome. Can anyone help me to translate this jQuery-Ajax call into breeze.js ? ... or push me in the right direction? $.ajax({ url: “../_api/SP.WebProxy.invoke”, type: “POST”, data: JSON.stringify({ “requestInfo”: { “__metadata”: { “type”: “SP.WebRequestInfo” }, “Url”: “http://get_my_data_from_this_url”

breezejs: calling savecChanges for a classic ODATA service fails

只谈情不闲聊 提交于 2019-11-28 09:48:39
问题 I'm trying to save an Entity that was loaded using a classic WEBAPI ODATA service. When saveChanges is called on the client side, the modified entity is found and then the code goes into ´createChangeRequests´ and because the entityState is modified it goes into the function : function updateDeleteMergeRequest(request, aspect, prefix) { var extraMetadata = aspect.extraMetadata; var uri = extraMetadata.uri; if (__stringStartsWith(uri, prefix)) { uri = uri.substring(prefix.length); } request

Breeze and Angular 'ToDo' app does not work with IE 8

萝らか妹 提交于 2019-11-28 09:27:13
I have downloaded the sample 'Breeze 0.83.5' applications from http://www.breezejs.com/documentation/download The Angular 'ToDo' sample does not work with IE8. I have included the following script references above my Breeze script reference. Any idea why this doesn't work? Breeze's Angular support makes use of the 'backingStoreAdapter' which in turn depends on the ES5 Javascript 'defineProperty' method being implemented by the browser. This was not implemented in IE8, and unfortunately, cannot be supplemented via the use of a shim. This is the only adapter that has this limitation, the breeze