* Seperate YesSql and added InMemory, MongoDb * Error fixed, if DatabaseInitializer is run through several times * icon.png was not packed * Added AddWorkflowProvider to AddElsaPersistenceMongoDb * Wrong primary keys were used for MongoDb * Refactorig MongoDb * Register IMongoCollection<WorkflowDefinition> and IMongoCollection<WorkflowInstance> with DI * Wrong Parameter Type in Constructor (MongoDbWorkflowInstanceRepository) * Add workflowDefinition.WorkflowDefinitionId = _idGenerator.Generate(); to Initialize * Removed duplicated code * Correct wrong Commit Co-authored-by: Rafael Carnucci <rafael.carnucci@icn.de> Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using Elsa.Samples.ContextualWorkflowHttp.Indexes;
|
|
using Elsa.Samples.ContextualWorkflowHttp.WorkflowContextProviders;
|
|
using Elsa.Samples.ContextualWorkflowHttp.Workflows;
|
|
using Elsa.Persistence.YesSql;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using YesSql.Provider.Sqlite;
|
|
using System.Data;
|
|
|
|
namespace Elsa.Samples.ContextualWorkflowHttp
|
|
{
|
|
public class Startup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services
|
|
.AddElsa()
|
|
.AddElsaPersistenceYesSql((sp, config) => config.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted))
|
|
.AddHttpActivities()
|
|
.AddConsoleActivities()
|
|
.AddDataMigration<Migrations>()
|
|
.AddIndexProvider<DocumentIndexProvider>()
|
|
.AddWorkflowContextProvider<DocumentWorkflowContextProvider>()
|
|
.AddWorkflow<DocumentApprovalWorkflow>();
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder app)
|
|
{
|
|
// Add HTTP activities middleware.
|
|
app.UseHttpActivities();
|
|
|
|
// Show welcome page if no routes matched any endpoints.
|
|
app.UseWelcomePage();
|
|
}
|
|
}
|
|
} |