コード例 #1
0
        public void Can_log_Brand_Deactivated()
        {
            var @event = new BrandDeactivated();

            _serviceBus.PublishMessage(@event);
            AssertAdminActivityLog(@event, AdminActivityLogCategory.Brand);
        }
コード例 #2
0
ファイル: BrandReport.cs プロジェクト: singlag888/aft-regov2
        public void Handle(BrandDeactivated deactivatedEvent)
        {
            var repository = _container.Resolve <IReportRepository>();

            //todo: refactor the following, updatedEvent.Id should not be the same as BrandId
            var record = repository.BrandRecords.SingleOrDefault(r => r.BrandId == deactivatedEvent.Id);

            if (record == null)
            {
                throw new RegoException(string.Format(BrandNotFoundMessage, deactivatedEvent.Id));
            }

            record.BrandStatus   = BrandStatus.Deactivated.ToString();
            record.Deactivated   = deactivatedEvent.EventCreated;
            record.DeactivatedBy = deactivatedEvent.EventCreatedBy;
            repository.SaveChanges();
        }
コード例 #3
0
 public void Consume(BrandDeactivated message)
 {
     _eventHandlers.Handle(message);
 }
コード例 #4
0
 public void Handle(BrandDeactivated @event)
 {
     AddActivityLog(AdminActivityLogCategory.Brand, @event);
 }