示例#1
0
        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);
        }
示例#2
0
        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);
                    }
                }
            }
        }