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.
精彩评论