breeze

Breeze - How to Load Navigation property from cache

主宰稳场 提交于 2019-12-07 12:28:49
问题 I am getting a single entity by using a method fetchEntityByKey , after that I am loading navigation property for the entity by entityAspect.loadNavigationProperty . But loadNavigationProperty always make a call to the server, what I am wondering if I can first check it from cache, if it is exist then get it from there otherwise go the server. How is it possible? Here is my current code return datacontext.getProjectById(projectId) .then(function (data) { vm.project = data; vm.project

Is withParameters still supported in Breeze entity query?

試著忘記壹切 提交于 2019-12-07 11:24:06
问题 I tried to use withParameters method on query like that: query.withParameters({ includeLocation: true }) Unfortunately my parameter was not added to url. I use breeze.debug.js and I've found this line in it //queryOptions = __extend(queryOptions, this.parameters); Is that a bug ? Is withParameters support taken out ? Or do I do something wrong ? I use oData 回答1: When .withParameters is used, the parameters are added to the URL by the data service adapter, not by the Breeze core. That's why

Self-referencing many-to-many relationship EF code first

不羁的心 提交于 2019-12-07 11:17:17
问题 I work with ASP.NET MVC With Durandal/Breeze templates. Let's say I have the following class: public class Person { public int Id { get; set; } public string Firstname { get; set; } public string Lastname { get; set; } public virtual List<Person> Friends { get; set; } } With the following EF Fluent API: modelBuilder.Entity<Person>() .HasMany(m => m.Friends) .WithMany() .Map(m => m.ToTable("Friends")); The database is generated successfully. The problem is when I perform a que ry with Breeze

Chrome//kendoUI/jQuery: Maximum call stack size exceeded

笑着哭i 提交于 2019-12-07 11:14:39
问题 I am working hottowell template to create spa application and I am getting a nice error from jquery. Basically my problem start at the moment to try bind my view from viewModelBinder.js (from durandal library). viewModelBinder.beforeBind(obj, view); action(); viewModelBinder.afterBind(obj, view); at the moment to call beforeBind this code is executed (main.js of my own app) kendo.ns = "kendo-"; viewModelBinder.beforeBind = function (obj, view) { kendo.bind(view, obj.viewModel || obj); };

Breeze entities with typescript

老子叫甜甜 提交于 2019-12-07 08:07:45
问题 I'm using Breeze + Typescript + Knockout for a Spa, and I'm facing the following problem: when I create a new entity with EntityManager.createEntity, typescript doesn't let me use the observables that Breeze generates from metadata. Typescript "sees" only the "entityAspect" and the "entityType" properties. I'm using the type definitions of DefinitelyTyped. Any help is greatly appreciated! 回答1: You can create an interface for your type which extends breeze.Entity : /// <reference path="breeze

Breeze: Remove entities from cache that is removed from database by another user without clearing the whole cache?

心不动则不痛 提交于 2019-12-07 06:50:44
问题 Im facing a problem that probably is quite common but i can't find any solution to it. The problem occurs when a user has entities in its cache on the client and another user removes some of those entities (on the server). When the first user then wants to update its data the removed entities is not removed from the cache. You could solve it by clearing the cache each time you update but then you also looses all non-saved changes. Am I missing something obvious? Example: Model: public class

Counts in Breeze.js

倾然丶 夕夏残阳落幕 提交于 2019-12-07 06:43:03
问题 I have a complex query that returns item counts. If I run a query on the client, will it always return the objects, or is there a way to just return the item counts without sending the object array in the payload? I tried doing something like var query = breeze.EntityQuery.from('Items').inlineCount(true); but that still pulls all the records down. Any solutions? 回答1: I don't know if this exactly answers your question, but you would need to query the records in order to know how many there are

System.Web.Http reference defaults to 4.0 version no matter how I try

蹲街弑〆低调 提交于 2019-12-06 22:08:17
问题 I am using the BreezeApi NuGet package in my project. It is in Visual Studio 2013. I get this error. Error 41 Assembly 'Breeze.WebApi2, Version=1.4.0.0, Culture=neutral, PublicKeyToken=f6085f1a45e2ac59' uses 'System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' I don't know why my project keeps referencing the 4.0 version.

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

天大地大妈咪最大 提交于 2019-12-06 21:36:28
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) return; // check if the related entity is already hooked up var thisEntity = relatedEntity

Breeze $filter projections

老子叫甜甜 提交于 2019-12-06 16:06:11
I am having an issue trying to filter data because breeze is adding the $filter clause at the end of the URL and the WCF\odata service is throwing filter cannot be after select clause. public IQueryable<order> Orders() { string owner= Membership.GetUser(Thread.CurrentPrincipal.Identity.Name).owner; IQueryable<Consigne> q = this.db.Consignes // .AddQueryOption("Dest", dest) .Where(x => x.Owner == owner) .Select(f => new order{ Name= f.Name, Address1 = f.Address1, Address2 = f.Address2, Address3 = f.Address3 }); return q; } I'm already limiting the result set with the server side Where clause