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