开发者

WCF RIA Services Insert Child Items along with New Parent Item

Say I have a object called project, and each project has tasks... Lets say I wanted to create a project and specify tasks...Do all this in one form...and when the user clicks 'save', save the project and tasks...However because project does not exi开发者_开发知识库st, when I create the tasks, they won't have a pk? How Can I handle this...be able to insert child with new parent...

Thanks,

Malcom


With Linq:

Project project = new Project();
project.Tasks = tasks;
db.SubmitChanges();

Linq will assign the primary keys and foreign keys.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜