I'm developing a spa web application with BreezeJS and the DurandalJS Framework. I came accross a problem which I cant't fix.
Here goes: I have a entity called: Car, this entity contains name, number, owner, type en manufacturer. In this entity the name and number are filled in as the entity is created AND saved in the database. THe other property's are allowed to be NULL.
This because the other values are filled in during a modal/ dialog screen. Here a user can select a owner from a list and also a type and manufacturer from a list. When the user selects one from a dropdown the selected value should be assigned to the value of the Car entity. But for no way I can get this to work, does anyone knows how?
Car().Owner = newOwner;
Car.Owner() = newOwner;
This won't work. I tried a lot of combo's. Remember that the value was null first and that I cant insert a new value;S
EDIT 1:----> Here the Entity Framework model of Car
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Estimate_App.Models
{
public class tblCar
{
[Key]
public int CarID { get; set; }
public string CarNumber { get; set; }
private DateTime _CreationDate;
public DateTime CreationDate
{
get { return this._CreationDate; }
set { this._CreationDate = DateTime.Now; }
}
//This is the Owner
[ForeignKey("Owner")]
public int? OwnerID { get; set; }
public tblOwner Owner { get; set; }
}
}
Here is what I put in my Car().Owner(), consider Container should be Car ;) (this is an other project with the same problem)
I hover my mouse over newValue.
If you need more info let me know!
Edit 2 ---28 may 2013-->
By a answer of Julián Yuste I also tried this but it didn't worked
Here the error: When I do
Container().Owner(newValue);
Edit 3 ---29 may 2013--> The code that fetches the owners
breeze.EntityQuery.from("Customers")
.using(dataservice.manager)
.execute().then(function (data) {
data.results.forEach(function (item) {
tempCustomerList.push(item); //ko.observableArray([]);
});
}).fail(function (data) {
});