开发者

DataContext SubmitChanges

I am using LINQ-to-SQL. I have retrieved an Entity called FileType using FileTypeID from the respository. Now I have created an entity called ExportFile. ExportFile is a child of FileType.

so here is what I have done:

var itemType = Repository.Current.ItemRepository.GetItemTypeByID(100);

Now I create a开发者_Go百科 ExportFile Entity as follows:

var exportItem = new Item() { GroupNumber = "000" };
itemType.Add(exportItem);

And then I do the following:

Repository.Current.SubmitAllChanges();

Now my question is: should ExportFile be added to the database or do we need to use the add entity of the dataContext explictly.

Thanks in advance!


DomainRepositoryManager.Current.SubmitAllChanges(); would be good to save the changes in the database.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜