我正在尝试通过WCF服务调用插入与[Shows]
具有1对多关系的新[Performances]
记录。
已创建[Shows]
记录,但[Performances]
记录未创建。不会抛出任何错误。如何创建性能记录呢?
客户端
Dim oShow As New Show With
{
'Properties here...
}
Dim cPerformances As New Collections.ObjectModel.Collection(Of Performance)
cPerformances.Add(New Performance With
{
'Properties here...
})
cPerformances.Add(New Performance With
{
'Properties here...
})
oShow.Performances = cPerformances
Dim myServiceRef As New myWCFService.ServiceName
myServiceRef.CreateShow(oShow)
服务
Dim ctx As New myEntities(ServiceURI)
ctx.AddToShows(oShow)
ctx.SaveChanges()
答案 0 :(得分:0)
我删除并重新创建了edmx,现在正在插入相关对象。