public void Initialize() { ConfigureFromCanConfigurables(); InitializeCulture(); var initializers = new Action[] { () => Serialization.Initialize(Container), () => Commands.Initialize(Container), () => Events.Initialize(Container), () => Tasks.Initialize(Container), () => Views.Initialize(Container), () => Sagas.Initialize(Container), () => Frontend.Initialize(Container), () => CallContext.Initialize(Container), () => ExecutionContext.Initialize(Container), () => Security.Initialize(Container), () => DefaultStorage.Initialize(Container) }; #if (SILVERLIGHT) initializers.ForEach(initializer => initializer()); #else Parallel.ForEach(initializers, initializator => initializator()); #endif ConfigurationDone(); }
public ActionResult DeleteConfirmed(int id) { Sagas sagas = db.Sagas.Find(id); db.Sagas.Remove(sagas); db.SaveChanges(); return(RedirectToAction("Index")); }
public SagaInfo[] GetReactingSagas(AggregateEventInfo aggregateEventInfo) { if (aggregateEventInfo == null) { throw new ArgumentNullException(nameof(aggregateEventInfo)); } return(Sagas.Where(x => x.AggregateEvents.Contains(aggregateEventInfo)).ToArray()); }
public ActionResult Edit([Bind(Include = "id_sagas,nombre_saga")] Sagas sagas) { if (ModelState.IsValid) { db.Entry(sagas).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sagas)); }
public ActionResult Create([Bind(Include = "id_sagas,nombre_saga")] Sagas sagas) { if (ModelState.IsValid) { db.Sagas.Add(sagas); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sagas)); }
public new void SetUp() { persister = new InMemorySagaPersister(); FuncBuilder.Register <ISagaPersister>(() => persister); sagas = new Sagas(); FuncBuilder.Register <SagaConfigurationCache>(() => sagas.sagaConfigurationCache); conventions = new Conventions(); }
// GET: Sagas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Sagas sagas = db.Sagas.Find(id); if (sagas == null) { return(HttpNotFound()); } return(View(sagas)); }
public async Task retrieve_should_load_saga_by_correlated_property() { // arrange var storedData = new ProcurementData() { Id = NewGuid(), OrderId = NewGuid() }; var correlationProperty = new CorrelationProperty(Metadata.CorrelationProperty, storedData.OrderId, isDefaultValue: false); await Sagas.Store(storedData, correlationProperty, CancellationToken.None); // act var retrievedData = await Sagas.Retrieve <ProcurementData>(nameof( ProcurementData.OrderId ), storedData.OrderId, CancellationToken.None); // assert retrievedData.Should().BeEquivalentTo(storedData); }
public async Task retrieve_should_not_return_a_saga_marked_completed() { // arrange var storedData = new ProcurementData() { Id = NewGuid(), OrderId = NewGuid() }; var correlationProperty = new CorrelationProperty(Metadata.CorrelationProperty, storedData.OrderId, isDefaultValue: false); await Sagas.Store(storedData, correlationProperty, CancellationToken.None); // act await Sagas.Complete(storedData, CancellationToken.None); var retrievedData = await Sagas.Retrieve <ProcurementData>(storedData.Id, CancellationToken.None); // assert retrievedData.Should().BeNull(); }
/// <summary> /// Create a new database connection. /// </summary> /// <returns>A new, configured <see cref="DbConnection">database connection</see>.</returns> /// <exception cref="InvalidOperationException">The underlying configurations do not all use the same database connection string.</exception> public virtual DbConnection CreateConnection() { Contract.Ensures(Contract.Result <DbConnection>() != null); var connection = Messages.CreateConnection(); var comparer = StringComparer.OrdinalIgnoreCase; using (var connection2 = Events.CreateConnection()) { if (comparer.Equals(connection.ConnectionString, connection2.ConnectionString)) { using (var connection3 = Sagas.CreateConnection()) { if (comparer.Equals(connection.ConnectionString, connection3.ConnectionString)) { return(connection); } } } } throw new InvalidOperationException(SR.InvalidPersistenceConfiguration); }
#pragma warning disable 1591 // Xml Comments public CommandResult Handle(Sagas.ISaga saga, ICommand command) { throw new NotImplementedException(); }