public UserEventProcessor()
        {
            eventObservable = DbObservable <BiContext>
                              .FromInserting <EventEntity>()
                              .Where(e => e.Entity.Body is UserEvent);

            eventObservable.Where(e => e.Entity.Body is UserCreatedEvt)
            .Subscribe(onCreate);
            eventObservable.Where(e => e.Entity.Body is UserUpdatedEvt)
            .Subscribe(onUpdate);
            eventObservable.Where(e => e.Entity.Body is PasswordChangedEvt)
            .Subscribe(onPasswordChange);
        }
Exemple #2
0
        public PermissionEventProcessor()
        {
            eventObservable = DbObservable <BiContext>
                              .FromInserting <EventEntity>()
                              .Where(entry => entry.Entity.Body is PermissionEvent);

            eventObservable
            .Where(entry => entry.Entity.Body is PermissionGivenEvt)
            .Subscribe(onGiven);
            eventObservable
            .Where(entry => entry.Entity.Body is RoleRemovedEvt)
            .Subscribe(onRoleRemoved);
            eventObservable
            .Where(entry => entry.Entity.Body is PermissionsRevokedEvt)
            .Subscribe(onRevoked);
        }
Exemple #3
0
        public CotationSeed(IntranetDbContext ctx, ApiSettings settings, IMapper mapper) : base(ctx, settings, mapper)
        {
            _cotationPieceObserveInserting = DbObservable <IntranetDbContext> .FromInserting <CotationPiece>();

            _cotationPieceObserveInserting.Subscribe(entry =>
            {
                var _params = Context.Parametres.Local.Where(p => p.CodePrimaire == Settings.CodePrimaire.Format && p.CodeSecondaire > 0).ToList();
                foreach (var _param in _params)
                {
                    var cotpiecform = Mapper.Map <CotationPieceFormat>(_param);
                    if (cotpiecform == null)
                    {
                        continue;
                    }
                    cotpiecform.Piece = entry.Entity;
                }
            });
        }
Exemple #4
0
        public CompanyEventProcessor()
        {
            eventObservable = DbObservable <BiContext>
                              .FromInserting <EventEntity>()
                              .Where(entry => entry.Entity.Body is CompanyEvent);

            eventObservable
            .Where(entry => entry.Entity.Body is CompanyCreatedEvt)
            .Subscribe(onCreate);
            eventObservable
            .Where(entry => entry.Entity.Body is CompanyUpdatedEvt)
            .Subscribe(onUpdate);
            eventObservable
            .Where(entry => entry.Entity.Body is ModuleAddedEvt)
            .Subscribe(onAddModule);
            eventObservable
            .Where(entry => entry.Entity.Body is CompanyDeletedEvt)
            .Subscribe(onDelete);
        }
Exemple #5
0
        private void Initialize()
        {
            _cotationPieceObserveInserted = DbObservable <IntranetDbContext> .FromInserting <CotationPiece>();

            _cotationPieceObserveInserted.Subscribe(entry =>
            {
                var _params = this.Parametres.Local.Where(p => p.CodePrimaire == _settings.CodePrimaire.Format && p.CodeSecondaire > 0).ToList();
                foreach (var _param in _params)
                {
                    var cotpiecform = _mapper.Map <CotationPieceFormat>(_param);
                    if (cotpiecform == null)
                    {
                        continue;
                    }
                    cotpiecform.Piece = entry.Entity;
                    entry.Entity.Formats.Add(cotpiecform);

                    CotationsPiecesFormats.Add(cotpiecform);
                }
            });
        }
Exemple #6
0
        public ReportEventProcessor()
        {
            var eventObs = DbObservable <BiContext> .FromInserting <EventEntity>();

            eventObs.Where(evt => evt.Entity.Body is ReportUpdatedEvt).Subscribe(OnUpdate);
        }
 public EventRepository(BiContext context)
 {
     this.context = context;
     this.evtObs  = DbObservable <BiContext> .FromInserting <EventEntity>();
 }