javascript - EntityAspect property still not avail after adding an expand clause to a BreezeJS query -



javascript - EntityAspect property still not avail after adding an expand clause to a BreezeJS query -

this follow question ziad asked on 13 nov 2013. question in regard entityaspect property no longer available after adding expand clause in breezejs. appeared functionality worked in v1.4.3, after upgrading v1.4.5 ef6 , webapi2, functionality no longer available. have breeze client of v1.5, ef 6.1.1 , webapi 2.2 , functionality still has not been restored. questions are: functionality ever restored and, if not, there workaround available. unless can find way overcome issue, have major breeze, knockout, durandal based application dead in water.

i have stolen ziad illustration code. hope not mind because illustrates problem. code works fine:

var query = breeze.entityquery.from("products").take(1);

the entityaspect property row available.

however, when added expand clause:

var query = breeze.entityquery.from("products").expand("orders").take(1);

here code ziad used retrieve data:

var mgr = new breeze.entitymanager(rooturl + 'breeze/productsapi'); mgr.executequery(query, function (data) { alert(data.results[0].entityaspect); // undefined. });

the entityaspect property row undefined , fields retrieved showed plain values instead of knockoutjs type observables.

i able around issues of retrieved fields showing plain text. believe because used ko.observablearray instead of ko.observable. problem entityaspect not working on expand structures showstopper. cannot maintain ui , underlying breeze cache synchronized. savechanges functionality seem work reliably. trying create work has produced hours of frustration.

i either walk away breeze/knockout project or homecoming version of project used durandal, odata, , knockout. project worked when used odata. overhead needed save construction complex, worked. without ability utilize entityaspect throughout expanded structure, using breeze/knockout appears unusable option.

what interesting note using visual studio 2013. intellisense vs 2013 indicates entityaspect functionality available. however, when run application, functionality not there.

if can help me solve problem, appreciate help , 3 weeks of total frustration come end.

unfortunately ziad receive no answers when raised question lastly in nov 2013. have been luck. cannot believe problem entityaspect not affecting big number of users in breeze/knockout programming community.

as explained in breeze web api documentation, cannot utilize web api [enablequery] or [queryable] attributes in controllers.

the[enablequery]/[queryable] attributes alter json.net serialization configuration such breeze client cannot recognize types of included entities. consequently, treats json info in expanded nodes plain old javascript objects, not entities entityaspect property.

the [breezequeryable] attribute preserves essential serialization configuration.

apply [breezequeryable] instead web api controller query method.

javascript knockout.js entity-framework-6 breeze

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -