javascript - Loading Breeze Navigation Properties offline -
I am using the latest versions of Kangaroo, Wind, EF.
I am creating a complex object called a customer who is added to the job, a quote measurement has been added to it. Navigation properties measuring one of the properties of QuoteMeasure are:
var quote = em.createEntity ("citation", {id: breeze.core.getUuid ()}), quotation measurement, Solution ; Measurement = _getMeasureFromLookups (4); Quotation marks = em.createEntity ("Quotation", {id: breeze.core.getUuid (), quoteId: quote.id}); I have tried to do the following on the server that executes the query
quoteMeasure.measureId = measure.id; QuoteMeasure.entityAspect.loadNavigationProperty ("Measurement"). Then (function () {console.log (quoteMeasure.measure);}); quote.quoteMeasures.push (quoteMeasure); Job.quotes.push (quote); URL / Breeze / Data / Measures? $ Filter = id = 20eq% 204 and
which do not exist. I would ideally like to set up the navigation property manually because it is static data and was previously obtained from the search of air on the server:
[HttpGet] Public Object Lookup () { var measures = unitoforkworks Major repository.Gate (empty, q => q.OrderBy (M => M. ordinal)). ToList (); Return new {remedy = measures}; } The _getMeasureFromLookups does the same function, it looks pre-archived measures. I want to specify it like this:
quoteMeasure.measure = measure; But I get the following meaningless error on the client:
Error: A is undefined M@//llhst/X/Scripts/breeze.min.js: 1 D / F / Asset @ // llhst / X / scripts / Hwakmunkj.as.: 5 _createNewQuote @ // llhst / X / script / app / services / jobs Service: JS: 76 < P> Let me suppose that because a whole tree of the object is downloaded by lookup instead of the individual measurement unit. There is a section on 'Repeating Navigation Properties' but then it tells you how to do this.
So my question is, what is the best practice to load navigation properties data offline? How can I modify the above sample so that it works?
If I understand your requirement correctly, then you need to create your own bid be able to remove a bid entities as follows:
var quote = em.createEntity ( "quotes", {id: breeze.core.getUuid ()}); // Assignment quote ID: quote.id is similar to quote. quoteMeasures.push (quoteMeasure) // A collection var quoteMeasure = em.createEntity ( "QuoteMeasure", {id: winds) it does not need to reconnect .core.getUuid (), quoteId: quote.id}); Var measurement = _getMeasureFromLookups (4); QuoteMeasure.measure = Measure; // or //quoteMeasure.measureId = measure.id // Your _getMeasureFromLookups should look something like this function _getMeasureFromLookups (measureId) to {// getEntityByKey client cash returns will measure em.getEntityByKey ( 'item', Volume ID); } Loader calling will start a query from the server.
The 'Opting Navigation Properties' section actually tells you how you can destroy the main aspect of the association. For example, it can be applied to your EF model, if you do not want a quotation to be able to navigate all quotes, you can do the following:
// EF Model Server Public Class Quote {// Simply remove or comment on this archive navigation property / Public Virtual Ilkonak & lt; QuoteMeasure & gt; Get quotation marks; Set; }} Hope this helps.
Comments
Post a Comment