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

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

The method is called for each entity to be saved before the save occurs. If this method returns 'false' then the entity will be excluded from the save. The base implementation returns the result of BeforeSaveEntityDelegate, or 'true' if BeforeSaveEntityDelegate is null.
protected BeforeSaveEntity ( EntityInfo entityInfo ) : bool
entityInfo EntityInfo
Результат bool
    protected internal virtual bool BeforeSaveEntity(EntityInfo entityInfo) {
      if (BeforeSaveEntityDelegate != null) {
        return BeforeSaveEntityDelegate(entityInfo);
      } else {
        return true;
      }
    }

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::BeforeSaveEntity