Exemplo n.º 1
0
 public void AddRelation(IReadonlyRelation <IRelatableEntity, IRelatableEntity> item)
 {
     ExecuteInCancellableTask(item,
                              TaskTriggers.Hive.Relations.PreRelationAdded,
                              TaskTriggers.Hive.Relations.PostRelationAdded,
                              () => ChildSessions.AddRelation(item, IdRoot));
 }
Exemplo n.º 2
0
 public void RemoveRelation(IRelationById item)
 {
     ExecuteInCancellableTask(item,
                              TaskTriggers.Hive.Relations.PreRelationRemoved,
                              TaskTriggers.Hive.Relations.PostRelationRemoved,
                              () => ChildSessions.RemoveRelation(item));
     ;
 }
Exemplo n.º 3
0
 public IEnumerable <IRelationById> GetParentRelations(HiveId childId, RelationType relationType)
 {
     return(UnitScopedCache.GetOrCreateTyped(
                "erg_GetParentRelations" + childId + (relationType != null ? relationType.RelationName : "any_relationtype"),
                () => ChildSessions.GetParentRelations(childId, IdRoot, relationType)));
 }
Exemplo n.º 4
0
 public void Delete <TEntity>(HiveId id) where TEntity : TypedEntity
 {
     FrameworkContext.TaskManager.ExecuteInCancellableTask(this, id, TaskTriggers.Hive.PreDelete, TaskTriggers.Hive.PostDelete, () => ChildSessions.Delete(id), x => new HiveEntityPreDeletionEventArgs(x, UnitScopedCache), x => new HiveEntityPostDeletionEventArgs(x, UnitScopedCache), FrameworkContext);
 }
Exemplo n.º 5
0
 public void AddOrUpdate(TypedEntity entity)
 {
     ExecuteInCancellableTask(entity, TaskTriggers.Hive.PreAddOrUpdate, TaskTriggers.Hive.PostAddOrUpdate, () => ChildSessions.AddOrUpdate(entity, IdRoot));
 }
 public void AddRelation(IReadonlyRelation <IRelatableEntity, IRelatableEntity> item)
 {
     ChildSessions.AddRelation(item, IdRoot);
 }
Exemplo n.º 7
0
 public IRelationById FindRelation(HiveId sourceId, HiveId destinationId, RelationType relationType)
 {
     return(ChildSessions.FindRelation(sourceId, destinationId, IdRoot, relationType));
 }
Exemplo n.º 8
0
 public IEnumerable <IRelationById> GetChildRelations(HiveId parentId, RelationType relationType)
 {
     return(ChildSessions.GetChildRelations(parentId, IdRoot, relationType));
 }
 public IEnumerable <IRelationById> GetParentRelations(HiveId childId, RelationType relationType)
 {
     return(ChildSessions.GetParentRelations(childId, IdRoot, relationType));
 }
 public void Delete <TEntity>(HiveId id) where TEntity : AbstractSchemaPart
 {
     ChildSessions.Delete <TEntity>(id);
 }
 public void AddOrUpdate(AbstractSchemaPart entity)
 {
     ChildSessions.AddOrUpdate(entity, IdRoot);
 }
 public bool Exists <TEntity>(HiveId id) where TEntity : AbstractSchemaPart
 {
     return(ChildSessions.Exists <TEntity>(id));
 }
 public IEnumerable <TEntity> GetAll <TEntity>() where TEntity : AbstractSchemaPart
 {
     return(ChildSessions.GetAll <TEntity>(this, IdRoot));
 }
 /// <summary>
 /// Gets a sequence of <see cref="TEntity"/> matching the specified ids.
 /// </summary>
 /// <typeparam name="TEntity">The type of the entity.</typeparam>
 /// <param name="allOrNothing">If set to <c>true</c> all ids must match in order to return any <typeparamref name="TEntity"/> instances.</param>
 /// <param name="ids">The ids.</param>
 /// <returns></returns>
 public IEnumerable <TEntity> Get <TEntity>(bool allOrNothing, params HiveId[] ids) where TEntity : AbstractSchemaPart
 {
     return(ChildSessions.Get <TEntity>(this, allOrNothing, IdRoot, ids));
 }
 public void RemoveRelation(IRelationById item)
 {
     ChildSessions.RemoveRelation(item);
 }
Exemplo n.º 16
0
 public IEnumerable <IRelationById> GetAncestorRelations(HiveId descendentId, RelationType relationType)
 {
     return(UnitScopedCache.GetOrCreateTyped(
                "erg_GetAncestorRelations" + descendentId + (relationType != null ? relationType.RelationName : "any_relationtype"),
                () => ChildSessions.GetAncestorRelations(descendentId, IdRoot, relationType)));
 }
Exemplo n.º 17
0
 public IEnumerable <IRelationById> GetDescendentRelations(HiveId ancestorId, RelationType relationType)
 {
     return(ChildSessions.GetDescendentRelations(ancestorId, IdRoot, relationType));
 }
 public IEnumerable <TEntity> GetAll <TEntity>() where TEntity : TypedEntity
 {
     return(ChildSessions.GetAll <TEntity>(this, IdRoot));
 }
Exemplo n.º 19
0
 public IEnumerable <IRelationById> GetBranchRelations(HiveId siblingId, RelationType relationType = null)
 {
     return(ChildSessions.GetBranchRelations(siblingId, IdRoot, relationType));
 }
Exemplo n.º 20
0
 /// <summary>
 /// Gets a sequence of <see cref="TEntity"/> matching the specified ids.
 /// </summary>
 /// <typeparam name="TEntity">The type of the entity.</typeparam>
 /// <param name="allOrNothing">If set to <c>true</c> all ids must match in order to return any <typeparamref name="TEntity"/> instances.</param>
 /// <param name="ids">The ids.</param>
 /// <returns></returns>
 public IEnumerable <TEntity> Get <TEntity>(bool allOrNothing, params HiveId[] ids) where TEntity : TypedEntity
 {
     return(ChildSessions.Get <TEntity>(this, allOrNothing, IdRoot, ids).Select(RaiseEntityReady));
 }
Exemplo n.º 21
0
 public IEnumerable <TEntity> GetAll <TEntity>() where TEntity : TypedEntity
 {
     return(ChildSessions.GetAll <TEntity>(this, IdRoot).Select(RaiseEntityReady));
 }
Exemplo n.º 22
0
 public bool Exists <TEntity>(HiveId id) where TEntity : TypedEntity
 {
     return(ChildSessions.Exists <TEntity>(id));
 }
Exemplo n.º 23
0
 protected override void DisposeResources()
 {
     ChildSessions.Dispose();
 }
Exemplo n.º 24
0
 public void Delete <TEntity>(HiveId id) where TEntity : TypedEntity
 {
     ChildSessions.Delete(id);
 }