Breeze.ContextProvider.ContextProvider.BeforeSaveEntities C# (CSharp) Метод

BeforeSaveEntities() защищенный Метод

Called after BeforeSaveEntity, and before saving the entities to the persistence layer. Allows adding, changing, and removing entities prior to save. The base implementation returns the result of BeforeSaveEntitiesDelegate, or the unchanged saveMap if BeforeSaveEntitiesDelegate is null.
protected BeforeSaveEntities ( Dictionary saveMap ) : List>.Dictionary
saveMap Dictionary A List of EntityInfo for each Type
Результат List>.Dictionary
    protected internal virtual Dictionary<Type, List<EntityInfo>> BeforeSaveEntities(Dictionary<Type, List<EntityInfo>> saveMap) {
      if (BeforeSaveEntitiesDelegate != null) {
        return BeforeSaveEntitiesDelegate(saveMap);
      } else {
        return saveMap;
      }
    }

Usage Example

Пример #1
0
 public void BeforeSave()
 {
     SaveMap = new Dictionary <Type, List <EntityInfo> >();
     EntitiesWithAutoGeneratedKeys = new List <EntityInfo>();
     EntityInfoGroups.ForEach(eg => {
         var entityInfos = eg.EntityInfos.Where(ei => ContextProvider.BeforeSaveEntity(ei)).ToList();
         EntitiesWithAutoGeneratedKeys.AddRange(entityInfos.Where(ei => ei.AutoGeneratedKey != null));
         SaveMap.Add(eg.EntityType, entityInfos);
     });
     SaveMap = ContextProvider.BeforeSaveEntities(SaveMap);
 }
All Usage Examples Of Breeze.ContextProvider.ContextProvider::BeforeSaveEntities