Kendo DataSource, AngularJS - undefined property - angularjs

I want to fill a grid with a complex json returned from a webservice. My json contains two things:
data: array with the records that will fill the grid
columns: array with the config(layout) of the grid
I have successfully filled the grid with the "data" by specifying the schema.data.
My problem is with the grid config (layout). I get the columns array on the requestEnd event of the datasource and i add it to the customersSource (datasource) so i can access it in the gridOptions.
The problem is that even though when i log the customersSource object i see that the cols array i added, is there and is filled with the proper data the $scope.mainGridOptions.columns isn't set to customersSource.cols.
I think that this may have to do with the fact that customersSource.cols is set asynchronously but shouldn't angular take care of this with it's databinding?
Also i have read in Data source vs. Angular that i may have to set something as Observable but i am confused of what to do exactly.
How can i fix this?
Here is my code:
var customersSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://....",
dataType: "json"
}
},
schema: {
data: "data"
},
requestEnd: function (e) {
this.cols = e.response.columns;
}
});
$scope.mainGridOptions = {
dataSource: customersSource, // OK
columns: customersDataSource.cols, // undefined - uses default
height: 500,
scrollable: true,
selectable: true
};
Here is my JSON
{
"data": [
{
"id": 0,
"firstname": "Dalton",
"lastname": "Holden",
"gender": "male",
"email": "daltonholden#tellifly.com",
"phone": "871-407-2973",
"address": "22 National Drive, Brenton, Louisiana",
"birthday": "21/04/1965",
"currency": "GBP"
},
{
"id": 1,
"firstname": "Allyson",
"lastname": "Odom",
"gender": "female",
"email": "allysonodom#tellifly.com",
"phone": "922-548-2725",
"address": "44 Quincy Street, Thynedale, Georgia",
"birthday": "28/08/1961",
"currency": "CHF"
},
{
"id": 2,
"firstname": "Sweet",
"lastname": "Branch",
"gender": "male",
"email": "sweetbranch#tellifly.com",
"phone": "880-593-2244",
"address": "81 Fenimore Street, Veguita, Missouri",
"birthday": "08/08/1953",
"currency": "AUD"
}
],
"columns": [
{
"field": "firstname",
"title": "Frist Name",
"width": 200,
"attributes": {
"class": "",
"style": "text-align: left;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: left;"
}
},
{
"field": "lastname",
"title": "Last Name",
"attributes": {
"class": "",
"style": "text-align: left;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: left;"
}
},
{
"field": "gender",
"title": "Gender",
"attributes": {
"class": "",
"style": "text-align: left;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: left;"
}
},
{
"field": "email",
"title": "e-mail",
"attributes": {
"class": "",
"style": "text-align: left;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: left;"
}
},
{
"field": "phone",
"title": "Phone Number",
"attributes": {
"class": "",
"style": "text-align: right;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: right;"
}
},
{
"field": "address",
"title": "Address",
"attributes": {
"class": "",
"style": "text-align: left;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: left;"
}
},
{
"field": "birthday",
"title": "Birthday",
"attributes": {
"class": "",
"style": "text-align: center;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: center;"
}
},
{
"field": "currency",
"title": "Currency",
"attributes": {
"class": "",
"style": "text-align: center;"
},
"headerAttributes": {
"class": "table-header-cell",
"style": "text-align: center;"
}
}
]
}
Edit
I created a plunker of my testing project. As you can see i can fill the grid but i have a problem with the mainGridOptions.columns. Any help will be much appreciated!
http://plnkr.co/edit/5pjFQGkgTivqVkxsFBse

It's because angularjs is unaware of changes made by 3rd party and you miss the magic two-way data binding. although I think promises would work great in your case
requestEnd: function (e) {
$scope.$apply(function(){
$scope.mainGridOptions.columns = e.response.columns
})
}

Related

Vega Chloropleth Map Visualisation

For some reason vega is reading my data as 0 when the numbers range from 1-234.
I am attempting to show a visualisation of a chloropleth map of crypto-ownership by country.
The countries have been ranked 1-234 and that is meant to show on the tooltip however, this is being shown as 0 on the tooltip. How do I fix this.
Here is my code:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title":{
"text": "Crypto Ownership Worldwide",
"subtitle": "Source: FILL",
"anchor": "start"
},
"width":500,
"height":400,
"data": {
"url": "https://raw.githubusercontent.com/tomiwav/tomiwav.github.io/main/custom.geo%20(3).json",
"format":{"property": "features"}
},
"projection":{"type": "mercator"},
"transform": [
{
"lookup":"properties.name",
"from":{
"key": "Country",
"fields": ["Rank"],
"data":{
"url": "https://raw.githubusercontent.com/tomiwav/tomiwav.github.io/main/datarank.csv",
"format":{"type":"csv"}
}
}
}
],
"mark":{
"type": "geoshape",
"fill":"lightgray",
"stroke":"black",
"strokeWidth":0.5
},
"encoding": {
"color": {
"field": "Rank",
"type": "quantitative",
"scale": {
"domain":[234,1],
"scheme": "oranges"
}
},
"tooltip":[
{"field":"properties.name", "title":"Country"},
{"field":"Rank","type":"quantitative","title":"Number of Crypto Owners","format":".2f"}
]
},
"config": {"mark": {"invalid": null}
}
}
Your lookup was failing. You need a lower case "c" on country.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Crypto Ownership Worldwide",
"subtitle": "Source: FILL",
"anchor": "start"
},
"width": 500,
"height": 400,
"data": {
"url": "https://raw.githubusercontent.com/tomiwav/tomiwav.github.io/main/custom.geo%20(3).json",
"format": {"property": "features"}
},
"projection": {"type": "mercator"},
"transform": [
{
"lookup": "properties.name",
"from": {
"key": "country",
"fields": ["Rank"],
"data": {
"url": "https://raw.githubusercontent.com/tomiwav/tomiwav.github.io/main/datarank.csv",
"format": {"type": "csv"}
} }
}
],
"mark": {
"type": "geoshape",
"fill": "lightgray",
"stroke": "black",
"strokeWidth": 0.5
},
"encoding": {
"color": {
"field": "Rank",
"type": "quantitative",
"scale": {"domain": [234, 1], "scheme": "oranges"}
},
"tooltip": [
{"field": "properties.name", "title": "Country"},
{
"field": "Rank",
"type": "quantitative",
"title": "Number of Crypto Owners",
"format": ".2f"
}
]
},
"config": {"mark": {"invalid": null}}
}

hide show widget conditionally in form using react-jsonschema-form liberary

I have created a form using below json configuration for react-jsonschema-form
{
"schema": {
"title": "Employee Detail",
"type": "object",
"required": ["name", "email", "country"],
"properties": {
"name": {
"type": "string",
"title": "Name",
"default": "",
"autoComplete": "off"
},
"email": {
"type": "string",
"title": "Email",
"default": ""
},
"registeredAddress": {
"type": "object",
"title": "Registered Address",
"properties": {
"line1": {
"type": "string",
"title": "Address Line1",
"default": ""
},
"line2": {
"type": "string",
"title": "Address Line2",
"default": ""
},
"city": {
"type": "string",
"title": "City",
"default": ""
},
"postal": {
"type": "string",
"title": "Postal",
"default": ""
},
"country": {
"type": "string",
"title": "Country",
"default": "",
"enum": ["IN", "PK", "CN"],
"enumNames": ["India", "Pakistan", "China"]
}
}
},
"isAddressDifferent": {
"type": "boolean",
"title": "Is Mailing Address different from Registered Address",
"default": false
},
"about": {
"type": "string",
"title": "About",
"default": "",
"autoComplete": "off"
}
},
"if": {
"properties": {
"isAddressDifferent": {
"const": true
}
}
},
"then": {
"properties": {
"mailingAddress": {
"type": "object",
"title": "Mailing Address",
"properties": {
"line1": {
"type": "string",
"title": "Address Line1",
"default": ""
}
}
}
}
}
}
}
I am hiding mailingAddress property on the basis of isAddressDifferent checkbox value, but I want to position mailingAddress on ui after that checkbox and above the about ui widget
Can anyone help me on this?
Below is the codesandbox url for code
https://codesandbox.io/s/rjfs-form-demo-mix96s?file=/src/custom-form/form-config.json

get dynamic data from the slot ? not added resolutionsPerAuthority's dynamic element in the list

I am trying to get dynamic data from the slot
As per documentation and my basic test I am sending directive from launch request as like :
{'version': '1.0', 'response': {'outputSpeech': {'type': 'SSML', 'ssml': '<speak> Hi, welcome to developement dynamic slot. <break time="800ms"/>Please tell me the product name you would be interested in</speak>'}, 'card': {'type': 'Simple', 'title': 'Choose a Medicine.', 'content': 'Pick a Medicine.'}, 'reprompt': {'outputSpeech': {'type': 'SSML', 'ssml': '<speak><break time="5s"/>I am HERE to help You, Please tell me the product and country names you would be interested in.</speak>'}}, 'shouldEndSession': False}, 'directives': [{'type': 'Dialog.UpdateDynamicEntities', 'updateBehavior': 'REPLACE', 'types': [{'name': 'products', 'values': [{'id': 'grnTea', 'name': {'value': 'green tea', 'synonyms': ['matcha']}}, {'id': 'oolTea', 'name': {'value': 'oolong', 'synonyms': ['chinese tea', 'black dragon tea']}}]}]}]}
and when I'm trying to get data which is not statically store in a slot but added in directive slot value.
returns following output :
{ "version": "1.0", "session": { "new": false, "sessionId": "amzn1.echo-api.session.671181ed-1e50-4e4c-b70e-4d854fe7cb78", "application": { "applicationId": "amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb" }, "user": { "userId": "amzn1.ask.account.sadasdsa", "permissions": { "consentToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ..XyWgyUIjDzzlZ12CR0lbZid6GxwZZYBgarlV-9difbkFjOTxrcvS9lJYWo-Db3wo-fIdXb_jZkCAJBtYPggqnJhLyyC-EDa0_u9aARKthF1_nkbLh5zDOHDb8MyyOYro4BJlqm4XBNd1qyeQUV2M4fdca1YSEnbEun_6kWOKeFRS-14zcwMj5E-MHcBbeDX799A_kay82kS8VGeMhSUsXPTZFrwOKHcFweJTqXFNOkBxME8kAFfS1JB5MNbA3TujVIsIgTBSNQaJeHRksConKt0u06ATrjffzFkcmbxDT5HoJH4NqDgS0y_GdtaeXQM3LJ-MN0-_DMX2QVEaL6kUUw" } } }, "context": { "System": { "application": { "applicationId": "amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb" }, "user": { "userId": "amzn1.ask.account.aasdasdasdasdas", "permissions": { "consentToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.asdjaskdhas.XyWgyUIjDzzlZ12CR0lbZid6GxwZZYBgarlV-9difbkFjOTxrcvS9lJYWo-Db3wo-fIdXb_jZkCAJBtYPggqnJhLyyC-EDa0_u9aARKthF1_nkbLh5zDOHDb8MyyOYro4BJlqm4XBNd1qyeQUV2M4fdca1YSEnbEun_6kWOKeFRS-14zcwMj5E-MHcBbeDX799A_kay82kS8VGeMhSUsXPTZFrwOKHcFweJTqXFNOkBxME8kAFfS1JB5MNbA3TujVIsIgTBSNQaJeHRksConKt0u06ATrjffzFkcmbxDT5HoJH4NqDgS0y_GdtaeXQM3LJ-MN0-_DMX2QVEaL6kUUw" } }, "device": { "deviceId": "amzn1.ask.device.ajshdjkhasjkhdkjsahkasdhjasd", "supportedInterfaces": {} }, "apiEndpoint": "https://api.eu.amazonalexa.com", "apiAccessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.asdhjashjdhajsd.RQhzWmnhN9K_dCbsFXBPPoLVzuwe5BWjAruwJNF1pVr11PiygVgQ64W3CNng2sK1thT2tl6r3GuRtG-1133Aw1KPWtMuHElu7CTrFfgAqW8blpK37PJIvPMOUGBw1rbrgCTMdy8Ua7qSFV_Y_wlOJaV3-apDGBqhQKE_-dE-ntWYZuIySlY3l8hBs_66eELS-LiL5DEDJk1hfvC2C6ZFB7A7P8mx4Hb71km-lYaElJS0-FDP0C-LdSp6dCbzV23W4JehtTGL4kJ1JEQgWyuNAAkt_HmPcEYlPp8T5RFceDuVuz-ZZBFyiVKuAN8VmxyFsmnC3SXi4yb3RKm1SCcorg" }, "Viewport": { "experiences": [ { "arcMinuteWidth": 246, "arcMinuteHeight": 144, "canRotate": false, "canResize": false } ], "shape": "RECTANGLE", "pixelWidth": 1024, "pixelHeight": 600, "dpi": 160, "currentPixelWidth": 1024, "currentPixelHeight": 600, "touch": [ "SINGLE" ], "video": { "codecs": [ "H_264_42", "H_264_41" ] } }, "Viewports": [ { "type": "APL", "id": "main", "shape": "RECTANGLE", "dpi": 160, "presentationType": "STANDARD", "canRotate": false, "configuration": { "current": { "video": { "codecs": [ "H_264_42", "H_264_41" ] }, "size": { "type": "DISCRETE", "pixelWidth": 1024, "pixelHeight": 600 } } } } ] }, "request": { "type": "IntentRequest", "requestId": "amzn1.echo-api.request.0f3b51f1-880b-483f-8410-3210e81e5b59", "timestamp": "2020-01-01T11:48:09Z", "locale": "en-IN", "intent": { "name": "productcheck", "confirmationStatus": "NONE", "slots": { "products": { "name": "products", "value": "green tea", "resolutions": { "resolutionsPerAuthority": [ { "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb.products", "status": { "code": "ER_SUCCESS_NO_MATCH" } } ] }, "confirmationStatus": "NONE", "source": "USER" } } } } }
It's not added resolutions resolutionsPerAuthority's second(dynamic) element in the list.
anybody can help me out from this problem?
I tested your added directive exactly as pasted and the dynamic entity resolved as expected:
"slots": {
"products": {
"name": "products",
"value": "matcha",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.****.products",
"status": {
"code": "ER_SUCCESS_NO_MATCH"
}
},
{
"authority": "amzn1.er-authority.echo-sdk.dynamic.amzn1.ask.skill.****.products",
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "green tea",
"id": "grnTea"
}
}
]
}
]
},
"confirmationStatus": "NONE",
"source": "USER"
}
}
Could you share your skill's interaction model to investigate further?

Multi-dimensional arrays in Mandrill with handlebars

I'm trying to loop through a multi-dimensional array to get properties of products that are part of line items. They look basically like this: (I did a json_encode so it would be easier to read)
[{
"rcpt": "email#email.com",
"vars": [{
"name": "SYSTEM",
"content": "Bikes"
}, {
"name": "CUSTOMERSERVICE",
"content": "(855-553-4889)"
}, {
"name": "IMAGE",
"content": "http:\/\/www.url.com\/assets\/images\/chicago\/email\/dear_member.jpg"
}, {
"name": "LINKCOLOR",
"content": "#3db7e4"
}, {
"name": "FACEBOOK",
"content": "Bikes"
}, {
"name": "TWITTER",
"content": "Bikes"
}, {
"name": "INSTAGRAM",
"content": "Bikes"
}, {
"name": "CLOSING",
"content": "Greetings"
}, {
"name": "item",
"content": [{
"lineItem": 1,
"id": "3",
"name": "24-Hour Pass Gift Certificate",
"quantity": 2,
"nameShort": "24-Hour",
"type": "Gift Certificate",
"image": "24hour_blank.jpg",
"price": "9.95",
"total": "19.90",
"taxable": false,
"giftCertificates": {
"3204": {
"id": "3204",
"redemptionNumber": "xxxxx",
"type": "24-Hour"
},
"3205": {
"id": "3205",
"redemptionNumber": "xxxxx",
"type": "24-Hour"
}
}
}, {
"lineItem": 2,
"id": "1",
"name": "Annual Membership Gift Certificate",
"quantity": 2,
"nameShort": "Annual",
"type": "Gift Certificate",
"image": "annual_blank.jpg",
"price": "75.00",
"total": "150.00",
"taxable": false,
"giftCertificates": {
"892": {
"id": "892",
"redemptionNumber": "xxxxxx",
"type": "Annual"
},
"893": {
"id": "893",
"redemptionNumber": "xxxxx",
"type": "Annual"
}
}
}]
}, {
"name": "orderID",
"content": 1220
}, {
"name": "giftMessage",
"content": false
}, {
"name": "email",
"content": "email#email.com"
}, {
"name": "transactionDate",
"content": "12\/23\/2015"
}, {
"name": "transactionTime",
"content": "12:21 pm"
}, {
"name": "salesTaxTotal",
"content": 0
}, {
"name": "salesTaxRatePercent",
"content": "6.250"
}, {
"name": "TransactionAmount",
"content": "169.90"
}, {
"name": "account_number",
"content": "XXXX1111"
}, {
"name": "card_type",
"content": "Visa"
}, {
"name": "firstName",
"content": "tetete"
}, {
"name": "lastName",
"content": "tethuhhu"
}, {
"name": "address",
"content": "295 Place St"
}, {
"name": "city",
"content": "Brooklyn"
}, {
"name": "state",
"content": "NY"
}, {
"name": "zip",
"content": "11238"
}, {
"name": "country",
"content": "US"
}, {
"name": "phone",
"content": "8888888888"
}, {
"name": "transactionId",
"content": "xxxxxx"
}, {
"name": "shipToFirstName",
"content": "tetete"
}, {
"name": "shipToLastName",
"content": "tethuhhu"
}, {
"name": "shipToAaddress",
"content": "295 Place St"
}, {
"name": "shipToCity",
"content": "Brooklyn"
}, {
"name": "shipToState",
"content": "NY"
}, {
"name": "shipToZipCode",
"content": "11238"
}, {
"name": "ShipToCountry",
"content": "US"
}, {
"name": "ShipToCountry",
"content": "US"
}]
}]
So I am trying to get a print out of each gift certificate's type and redemption number. When I iterate through {{ giftCertificates }} like this:
{{#each giftCertificates}}
{{type}} {{redemptionNumber}}
{{/each}}
I get one of the line items but not the other. I'm guessing maybe it is being overwritten when it loops through again? But I have also tried to loop through {{ item }} and grab {{ giftCertificates.type }} and {{ giftCertificates.redemptionNumber }} and that does not work either. What is the correct way to get all of these from each line item?
Thanks for your help.
I know this is a very old question, but:
you can use {{this.proprietyName}} to get the type and number:
{{#each giftCertificates}}
{{this.892.type}}
{{/each}}
do not forget to add this to the mandrill message o
"merge": true,
"merge_language": "handlebars",
Also, the data structure is not ideal:
giftCertificates[
{
"id": "892",
"redemptionNumber": "xxxxxx",
"type": "Annual"
},
{
"id": "893",
"redemptionNumber": "xxxxxx",
"type": "Annual"
}
]
would be easier to handle.

Cant Save relational Entities in breezejs

I have two entities created through manager.createEntity(type);.. z-validate wont display validation errors if i try to create them otherwise
..entity orderdetails must have a valid key from order. and later...
... //changed some stuff but never keys
orderdetails.Time = new Date();
orderdetails.order = order; //am i creating the relation right here?
The app will work great offline but when i save changes to the server..
manager.saveChanges([order,orderdetails]);
The sever is returning
...orderdetails","KeyValues":["fd...28"],"PropertyName":"order",ErrorMessage":"The order field is required."
Any idea how i can go through this? i have been reading documentations for days.
Metadata looks like this
{
"schema": {
"namespace": "Inventory.API",
"alias": "Self",
"annotation:UseStrongSpatialTypes": "false",
"xmlns:annotation": "http://schemas.microsoft.com/ado/2009/02/edm/annotation",
"xmlns:customannotation": "http://schemas.microsoft.com/ado/2013/11/edm/customannotation",
"xmlns": "http://schemas.microsoft.com/ado/2009/11/edm",
"cSpaceOSpaceMapping": "[\"Inventory.API.Order\",\"Inventory.API.Entities.Order\"],[\"Inventory.API.OrderDetail\",\"Inventory.API.Entities.OrderDetail\"],[\"Inventory.API.DifferentDetail\",\"Inventory.API.Entities.DifferentDetail\"]",
"entityType": [ {
"name": "Order",
"customannotation:ClrType": "Inventory.API.Entities.Order, Inventory.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": {
"propertyRef": {
"name": "Id"
}
},
"property": [{
"name": "Id",
"type": "Edm.Guid",
"nullable": "false",
"annotation:StoreGeneratedPattern": "Identity"
}, {
"name": "BarCode",
"type": "Edm.String",
"maxLength": "Max",
"fixedLength": "false",
"unicode": "true"
}, {
"name": "Name",
"type": "Edm.String",
"maxLength": "Max",
"fixedLength": "false",
"unicode": "true"
}, {
"name": "UnitPrice",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}, {
"name": "Count",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}],
"navigationProperty": [{
"name": "OrderDetails",
"relationship": "Self.OrderDetail_Order",
"fromRole": "OrderDetail_Order_Target",
"toRole": "OrderDetail_Order_Source"
}, {
"name": "DifferentDetails",
"relationship": "Self.DifferentDetail_Order",
"fromRole": "DifferentDetail_Order_Target",
"toRole": "DifferentDetail_Order_Source"
}]
}, {
"name": "OrderDetail",
"customannotation:ClrType": "Inventory.API.Entities.OrderDetail, Inventory.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": {
"propertyRef": {
"name": "Id"
}
},
"property": [{
"name": "Id",
"type": "Edm.Guid",
"nullable": "false",
"annotation:StoreGeneratedPattern": "Identity"
}, {
"name": "Time",
"type": "Edm.DateTime",
"nullable": "false"
}, {
"name": "UnitPrice",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}, {
"name": "Count",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}, {
"name": "TotalPrice",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}],
"navigationProperty": {
"name": "Order",
"relationship": "Self.OrderDetail_Order",
"fromRole": "OrderDetail_Order_Source",
"toRole": "OrderDetail_Order_Target"
}
}, {
"name": "DifferentDetail",
"customannotation:ClrType": "Inventory.API.Entities.DifferentDetail, Inventory.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": {
"propertyRef": {
"name": "Id"
}
},
"property": [{
"name": "Id",
"type": "Edm.Guid",
"nullable": "false",
"annotation:StoreGeneratedPattern": "Identity"
}, {
"name": "Time",
"type": "Edm.DateTime",
"nullable": "false"
}, {
"name": "UnitPrice",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}, {
"name": "Count",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}, {
"name": "TotalPrice",
"type": "Edm.Decimal",
"precision": "18",
"scale": "2",
"nullable": "false"
}],
"navigationProperty": {
"name": "Order",
"relationship": "Self.DifferentDetail_Order",
"fromRole": "DifferentDetail_Order_Source",
"toRole": "DifferentDetail_Order_Target"
}
}],
"entityContainer": {
"name": "InventoryContext",
"customannotation:UseClrTypes": "true",
"entitySet": [{
"name": "Orders",
"entityType": "Self.Order"
}, {
"name": "OrderDetails",
"entityType": "Self.OrderDetail"
}, {
"name": "DifferentDetails",
"entityType": "Self.DifferentDetail"
}],
"associationSet": [{
"name": "OrderDetail_Order",
"association": "Self.OrderDetail_Order",
"end": [{
"role": "OrderDetail_Order_Source",
"entitySet": "OrderDetails"
}, {
"role": "OrderDetail_Order_Target",
"entitySet": "Orders"
}]
}, {
"name": "DifferentDetail_Order",
"association": "Self.DifferentDetail_Order",
"end": [{
"role": "DifferentDetail_Order_Source",
"entitySet": "DifferentDetails"
}, {
"role": "DifferentDetail_Order_Target",
"entitySet": "Orders"
}]
}
}
}
You need to map the orderId foreign key property of the OrderDetail and DifferentDetail entities. When Breeze sends the entities to the server, it communicates the relationship between entities using the foreign keys.
I needed to map the orderId foreign key property of the OrderDetail and DifferentDetail entities. When Breeze sends the entities to the server, it communicates the relationship between entities using the foreign keys.
... The relation was there but breeze wont see it as it was defined like this
[Required]
public Order Order { get; set; }
And therefore I changed it to this
[Required]
public Guid Order_Id { get; set; }
[ForeignKey("Order_Id")]
public virtual Order Order{get; set;}
in the DBContext POCO classes then created a new copy of Metadata.

Resources