breeze

breeze: many-to-many issues when saving

你说的曾经没有我的故事 提交于 2019-11-28 02:13:41
I've been struggling for a while with many-to-many associations in a breeze app. I have issues both on the client and server side but for now, I'll just expose my client-side issue. I don't know if the approach I've come up with is correct or not, and I would really like to get feedback from the breeze team on this: My business model: public class Request { public virtual IList<RequestContact> RequestContacts { get; set; } } public class RequestContact { public virtual Contact Contact { get; set; } public virtual Guid ContactId { get; set; } public virtual Request Request { get; set; } public

Spin icon freezes while loading records

試著忘記壹切 提交于 2019-11-27 23:55:38
问题 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

Use jQuery or Q.Js for promises

社会主义新天地 提交于 2019-11-27 19:39:22
I'm looking into BreezeJs and there samples are using Q.js for promises to handle asynchronous calls. John Papa is also using Q. JQuery has promises as well . What are the differences between the two? Bergi Both are based on the Promises/A standard and implement a then method (though only current jQuery, they once had a incompatible pipe instead of then ). However, there are a few differences: Q has exception handling. All thrown errors in the async then callbacks will be caught and reject the promise (and will only get re-thrown if you call .end() ). Not sure whether I personally like that.

Current status of Upshot.js

五迷三道 提交于 2019-11-27 17:23:10
问题 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. 回答1: According to this blog post, Upshot is officially

how to add extend breeze entity types with metadata pulled from property attributes

筅森魡賤 提交于 2019-11-27 08:51:17
问题 I want to get the custom attributes, mentioned below, in breeze dataService (client side). namespace Tam.Framework.Web.Models { [ViewAttribute("app/views/Employee.html")]//this custom class attribute public class Employee : BaseEntity { protected override string OnGetDescriptor() { return "some description"; } public string FirstName { get; set; } [Display(Name = "LAST NAME")]//this custom property attribute public string LastName { get; set; } } } 回答1: On the server, add logic to the

How is breeze.js handling security and avoiding exposing business logic

折月煮酒 提交于 2019-11-27 08:13:41
We are considering breeze js to build enterprise applications. The awesomeness of breeze is that we can execute queries right from the client browser. This allows to constructs dynamic queries based on the users input without loading unnecessary data. I have found that using Breeze we can create business logic that reduces data traveling/transferring by 1/10 or even more when using a lazy loading strategy. using queries like these Hooray breeze!!! But what about Business Logic security, For example, We could have a repository in which we could conceal, hide and obscure our business logic; and

Ignore a property from a code first generated entity

前提是你 提交于 2019-11-27 06:52:59
问题 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 ? 回答1: 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

Many-to-many relations in Breeze

核能气质少年 提交于 2019-11-27 06:49:37
问题 i am defining some of my models atm using EF5 Code First. I have these three sample classes with a many-to-many relationship: public class Team { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Team_Id { get; set; } [MaxLength(150)] public string TeamName { get; set; } public virtual ICollection<User> Users { get; set; } [public virtual ICollection<Role> Roles { get; set; } // 1 [Timestamp] public byte[] TimeStamp { get; set; } } public class User { [Key,

Handling calculated properties with breezejs and web api

删除回忆录丶 提交于 2019-11-27 05:12:20
I'm experimenting with BreezeJS with Web API using the BreezeControllerAttribute. How should calculated properties on an entity be exposed? The only way I've found to do this reliably is to create an intermediate DTO that inherits from the entity or use a projection. Normally I would use a readonly property for this scenario, but those appear to be ignored. When Breeze maps JSON property data to entities, it ignores properties that it does not recognize . That's why your server class's calculated property data are discarded even though you see them in the JSON on the wire. Fortunately, you can

Using Breeze with a WebApi Service from another domain

左心房为你撑大大i 提交于 2019-11-27 03:36:42
问题 How can I use an existing webapi service with breeze? Note that my webapi service resides at "server1/api" and the web application is at "server2". I tried changing the service name in the dataservice, but get an XMLHttpRequest Exception 101. This is a cross domain error. Is it possible to use breeze with a webapi service from another domain? 回答1: Cross-origin Breeze Apps Yes it is possible to get the Breeze client app from one server and have that Breeze app communicate with a data service