This question is locked. New answers and comments are not allowed.
Hi,
I have 3 tables. and have foriegn key association setup and the classes generated are below. I have created a metadata class so to include the association. Using RIA and in silverlight I can query the Table1tablelink and this pulls back all the records for this entity including the associated Table1 entities which is what I expect. When I insert a new record into the Table1table2link like Mycontext.Table1table2links.Add(new Table1table2link(){Table1_Id=3, Table2_Id =5}); I then submit it and the Table1table2link_Id gets populated with the new correct id but the associated Table1 entity is null. When debugging and looking at the domainservice open access callback function for the insert I can clearly see that the Table1 entity has been properly populated with the correct association but this seems to get lost when returned back to the silverlight app.
Is there something else I need to set to make this return.
Table1 class looks like this
Table2 class looks like this
Table1Table2Link class looks like this
I have a metadata class for Table1table2link
Thanks
I have 3 tables. and have foriegn key association setup and the classes generated are below. I have created a metadata class so to include the association. Using RIA and in silverlight I can query the Table1tablelink and this pulls back all the records for this entity including the associated Table1 entities which is what I expect. When I insert a new record into the Table1table2link like Mycontext.Table1table2links.Add(new Table1table2link(){Table1_Id=3, Table2_Id =5}); I then submit it and the Table1table2link_Id gets populated with the new correct id but the associated Table1 entity is null. When debugging and looking at the domainservice open access callback function for the insert I can clearly see that the Table1 entity has been properly populated with the correct association but this seems to get lost when returned back to the silverlight app.
Is there something else I need to set to make this return.
Table1 class looks like this
namespace DA
{
public partial class Table1
{
private int _table1Id;
public virtual int Table1_id
{
get
{
return this._table1Id;
}
set
{
this._table1Id = value;
}
}
private string _name;
public virtual string Name
{
get
{
return this._name;
}
set
{
this._name = value;
}
}
private IList<
Table1table2link
> _table1table2links = new List<
Table1table2link
>();
public virtual IList<
Table1table2link
> Table1table2links
{
get
{
return this._table1table2links ;
}
}
}
}
Table2 class looks like this
namespace DA
{
public partial class Table2
{
private int _table2Id;
public virtual int Table2_id
{
get
{
return this._table2Id;
}
set
{
this._table2Id = value;
}
}
private string _name;
public virtual string Name
{
get
{
return this._name;
}
set
{
this._name = value;
}
}
private IList<
Table1table2link
> _table1table2links = new List<
Table1table2link
>();
public virtual IList<
Table1table2link
> Table1table2links
{
get
{
return this._table1table2links ;
}
}
}
}
Table1Table2Link class looks like this
namespace DA
{
public partial class Table1table2link
{
private int _table1Id;
public virtual int Table1_id
{
get
{
return this._table1Id;
}
set
{
this._table1Id = value;
}
}
private int _table2Id;
public virtual int Table2_id
{
get
{
return this._table2Id;
}
set
{
this._table2Id = value;
}
}
private int _table1table2linkId;
public virtual int Table1table2link_id
{
get
{
return this._table1table2linkId;
}
set
{
this._table1table2linkId= value;
}
}
private Table1 _table1;
public virtual Table1 Table1
{
get
{
return this._table1;
}
set
{
this._table1= value;
}
}
private Table2 _table2;
public virtual Table2 Table2
{
get
{
return this._table2;
}
set
{
this._table2= value;
}
}
}
}
I have a metadata class for Table1table2link
namespace DA
{
[MetadataTypeAttribute(typeof(Table1table2link.Table1table2linkMetadata))]
public partial class Table1table2link
{
internal sealed class Table1table2linkMetadata
{
[Include]
[Association("Table1", "Table1_id", "Table1_id")]
public Table1 Table1 { get; set; }
}
}
}
Thanks