예제 #1
0
파일: Commander.cs 프로젝트: henkin/brisk
        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);
        }
예제 #2
0
 public Host()
 {
     Publisher = new Publisher();
     Commander = new Commander();
     Eventer   = new Eventer();
 }
예제 #3
0
파일: Host.cs 프로젝트: henkin/brisk
 public Host()
 {
     Publisher = new Publisher();
     Commander = new Commander();
     Eventer = new Eventer();
 }
예제 #4
0
 private void Raise <TEntity>(EntityEvent <TEntity> created)
 {
     Eventer.Raise(created);
 }