breeze

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

限于喜欢 提交于 2019-12-05 17:39:02
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 (client side) I have no data for the Friends property. var query = entityQuery.from('Person') .where('id

Breeze entities with typescript

折月煮酒 提交于 2019-12-05 17:11:25
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! You can create an interface for your type which extends breeze.Entity : /// <reference path="breeze.d.ts" /> module model { export interface ResponsesItem extends breeze.Entity { ContentTypeID: string; Title:

AngularJs console.log “$q is not defined”

扶醉桌前 提交于 2019-12-05 16:36:40
问题 I am getting this error in the console $q is not defined . When I did some research I found some thing like .q library has been deprecated from http://www.breezejs.com/documentation/breeze-labs/breezeangularqjs If this is so, then the whole concept of promises is also deprecated, 回答1: Promises are not deprecated. In fact they're gaining quite a lot of momentum lately and are included in the next version of JavaScript. Let's look at what they say: This breeze.angular.q library has been

OData query filter for dateTime range

帅比萌擦擦* 提交于 2019-12-05 16:33:06
问题 I have a DateTime property in the data returned by a service that looks like "SDateTime":"2014-06-29T03:30:00.000" . I need to write a query to get a collection which has the date less than "2014-06-26T03:30:00.000" and greater than "2014-06-23T03:30:00.000" How to write a filter for the dateTime? Thanks. 回答1: $filter=SDateTime gt datetime'2014-06-26T03:30:00.000' and SDateTime lt datetime'2014-06-23T03:30:00.000' It works in this service: http://services.odata.org/V3/OData/OData.svc/Products

Using partials and projections of entities in Web API

醉酒当歌 提交于 2019-12-05 16:23:57
I am using breeze with Web API. I don't have a good grasp on how to "Filter columns" or how to not expose and entire table to my Web API. I am using the Entity Framework as my source, and both of my questions are addressed by John Papa here: http://www.johnpapa.net/spajs04/#comment-113761 and confirmed to be a good solution by Ward Bell below. Can someone please show me how I to use the entity framework to create a partial or projection that is queryable in my webapi and will work with breeze? Here is my current function in the webapi [HttpGet] public IQueryable<Contact> GetContacts() { return

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

时光怂恿深爱的人放手 提交于 2019-12-05 15:53:15
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); }; where kendo.bind is something like (kendo.web.js from kendo ui library): function bind(dom, object) { var

Is withParameters still supported in Breeze entity query?

ε祈祈猫儿з 提交于 2019-12-05 15:46:22
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 When .withParameters is used, the parameters are added to the URL by the data service adapter, not by the Breeze core. That's why that line is commented out. This allows the parameters to be encoded differently, depending upon the backend

Counts in Breeze.js

蹲街弑〆低调 提交于 2019-12-05 13:10:48
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? 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 (to my knowledge, there may be a more efficient way to tie Breeze directly into a SQL command that is way

Breezejs EntityManager MetadataStore and fetchEntityByKey

徘徊边缘 提交于 2019-12-05 12:04:47
I have a SPA application (durandaljs), and I have a specific route where I map the "id" of the entity that I want to fetch. The template is "/#/todoDetail/:id". For example, "/#/todoDetail/232" or "/#/todoDetail/19". On the activate function of viewmodel, I get the route info so I can grab the id. Then I create a new instance of breezejs EntityManager to get the entity with the given id. The problem is when I call manager.fetchEntityByKey("Todos", id), the EntityManager doesn't have yet the metadata from the server, so it throwing exception "Unable to locate an 'Type' by the name: Todos". It

How to ignore case using breeze FilterQueryOp

北城余情 提交于 2019-12-05 08:49:10
I am using breeze to query data from the server and seem to be running into problems. Is there a way to filter this data and ignore cases or making the value from the field a lower case? Example: var term = "john"; query = query.where("Name", "contains", Term); The problem I am having is if the 'Name' field contains John with capital 'J', It return false but returns true if I change term to 'John'. I know this is case issue but how can I make breeze ignore the casing? without using jquery.each. Thanks. Any help will be greatly appreciated. Ok, there are two parts to this. Breeze supports a