Esempio n. 1
0
        public CommandResult <Update <TEntity> > Update <TEntity>(TEntity entity) where TEntity : Entity
        {
            var entityService = GetEntityService <TEntity>();

            if (!entityService.Validate(entity))
            {
                return new CommandResult <Update <TEntity> >(null)
                       {
                           IsSuccess = false
                       }
            }
            ;

            entityService.Create(entity);
            var command = new Update <TEntity>(entity);

            Eventer.Raise <PersistenceEvent>(new Updated <TEntity>(entity));
            Persister.Update(entity);

            var commandResult = new CommandResult <Update <TEntity> >(command)
            {
                IsSuccess = true
            };

            return(commandResult);
        }
Esempio n. 2
0
 public Host()
 {
     Publisher = new Publisher();
     Commander = new Commander();
     Eventer   = new Eventer();
 }
Esempio n. 3
0
File: Host.cs Progetto: henkin/brisk
 public Host()
 {
     Publisher = new Publisher();
     Commander = new Commander();
     Eventer = new Eventer();
 }
Esempio n. 4
0
 private void Raise <TEntity>(EntityEvent <TEntity> created)
 {
     Eventer.Raise(created);
 }