private SaveEntitySet GetOrCreateEntitySet(Type entityType) { SaveEntitySet entitySet; if (!this.entitySets.TryGetValue(entityType, out entitySet)) { entitySet = SaveEntitySet.Create(entityType, this.context); this.entitySets.Add(entityType, entitySet); } return(entitySet); }
private void ExecuteSaveHandlers(SaveModel saveModel) { List <ISaveHandler> saveHandlers = CreateSaveHandlers(); foreach (ISaveHandler saveHandler in saveHandlers) { SaveEntitySet saveEntitySet = saveModel.GetEntitySet(saveHandler.EntityType); if (saveEntitySet != null) { foreach (SaveEntity saveEntity in saveEntitySet) { saveHandler.Save(saveEntity); } } } }