public override void Broadcast(FeatureBeeContext context, EventMessage eventMessage) { context.FeatureHistory.Add(new FeatureHistoryViewModel { Name = (eventMessage.Body as FeatureRemovedEvent).Name, Action = "Removed", Payload = "", Date = DateTime.Now, UserId = eventMessage.Headers["UserId"].ToString() }); }
public override void Broadcast(FeatureBeeContext context, EventMessage eventMessage) { context.FeatureHistory.Add(new FeatureHistoryViewModel { Name = (eventMessage.Body as FeatureReleasedWithConditionsEvent).Name, Action = "ChangedState", Payload = "Under Test", Date = DateTime.Now, UserId = eventMessage.Headers["UserId"].ToString() }); }
public override void Broadcast(FeatureBeeContext context, EventMessage eventMessage) { context.FeatureHistory.Add(new FeatureHistoryViewModel { Name = (eventMessage.Body as FeatureConditionsUpdatedEvent).Name, Action = "ConditionsChanged", Payload = Json.Encode((eventMessage.Body as FeatureConditionsUpdatedEvent).Conditions), Date = DateTime.Now, UserId = eventMessage.Headers["UserId"].ToString() }); }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureRemovedEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); context.Features.Remove(feature); }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureLinkedToTicketEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); feature.Link = body.Link; }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureDescriptionUpdatedEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); feature.Description = body.Description; }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureConditionsUpdatedEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); feature.Conditions.Clear(); feature.Conditions = body.Conditions.Select(ToConditionViewModel).ToList(); }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureReleasedForEveryoneEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); feature.Index = 2; feature.State = "Released"; }
public void Handle(EventMessage @event) { var databaseBroadcasterFor = this.databaseBroadcaster.FirstOrDefault(_ => _.ForType == @event.Body.GetType()); if (databaseBroadcasterFor == null) { return; } var context = new FeatureBeeContext(); databaseBroadcasterFor.Broadcast(context, @event); context.SaveChanges(); }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureReleasedWithConditionsEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); feature.Index = 1; feature.State = "Under Test"; }
public override void Broadcast(FeatureBeeContext context, object eventBody) { var body = @eventBody as FeatureRollbackedEvent; if (body == null) { return; } var feature = context.Features.Find(body.AggregateId); feature.Index = 0; feature.State = "In Development"; }
public void Handle(EventMessage @event) { var context = new FeatureBeeContext(); var databaseBroadcasterFor = this.databaseBroadcaster.FirstOrDefault(_ => _.ForType == @event.Body.GetType()); if (databaseBroadcasterFor != null) { databaseBroadcasterFor.Broadcast(context, @event.Body); } else { Debug.WriteLine("No broadcaster found for event {0}", @event.GetType()); } context.SaveChanges(); }
public override void Broadcast(FeatureBeeContext context, object eventBody) { try { var body = eventBody as FeatureCreatedEvent; context.Features.Add(new FeatureViewModel { Id = body.AggregateId, Name = body.Name, Description = body.Description, Team = body.Team, Index = 0, State = "In Development", Conditions = body.Conditions.Select(ToConditionViewModel).ToList() }); } catch (Exception e) { Debug.Write(e); } }
public abstract void Broadcast(FeatureBeeContext context, EventMessage eventMessage);
public FeatureBeeApiController() { context = new FeatureBeeContext(); }
public abstract void Broadcast(FeatureBeeContext context, object eventBody);