Use Sqlite as default db provider

This commit is contained in:
Sipke Schoorstra 2020-11-03 09:46:38 +01:00
parent 3e30af74fe
commit 884f54782d
11 changed files with 14 additions and 14 deletions

View file

@ -1,5 +1,4 @@
using Elsa.Activities.Primitives;
using Elsa.Builders;
using Elsa.Builders;
using Elsa.Services;
namespace Elsa.Activities.Workflows.Workflow

View file

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Elsa.Activities.Primitives;
using Elsa.Services;
using Elsa.Services.Models;
using Microsoft.Extensions.DependencyInjection;

View file

@ -1,4 +1,5 @@
using System;
using System.Data;
using Elsa.Caching;
using Elsa.DistributedLock;
using Elsa.Extensions;
@ -15,6 +16,7 @@ using YesSql;
using Elsa.YesSql.Provider.Sqlite.InMemory;
using Storage.Net;
using Storage.Net.Blobs;
using YesSql.Provider.Sqlite;
namespace Elsa
{
@ -24,7 +26,7 @@ namespace Elsa
{
Services = services;
ConfigurePersistence = (sp, config) => config.UseInMemorySqlite();
ConfigurePersistence = (sp, config) => config.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted);
StorageFactory = sp => Storage.Net.StorageFactory.Blobs.InMemory();
DistributedLockProviderFactory = sp => new DefaultLockProvider();
SignalFactory = sp => new Signal();

View file

@ -2,7 +2,6 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Elsa.Builders;
using Elsa.Models;
using Elsa.Services.Models;

View file

@ -13,7 +13,7 @@ namespace Elsa.Samples.ContextualWorkflowHttp
public void ConfigureServices(IServiceCollection services)
{
services
.AddElsa(option => option.UsePersistence(db => db.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted)))
.AddElsa()
.AddHttpActivities()
.AddConsoleActivities()
.AddDataMigration<Migrations>()

View file

@ -11,7 +11,7 @@ namespace Elsa.Samples.CorrelationHttp
public void ConfigureServices(IServiceCollection services)
{
services
.AddElsa(option => option.UsePersistence(db => db.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted)))
.AddElsa()
.AddHttpActivities()
.AddConsoleActivities()
.AddWorkflow<RegistrationWorkflow>();

View file

@ -19,7 +19,7 @@ namespace Elsa.Samples.DeclarativeCompositeActivitiesConsole
{
// Create a service container with Elsa services.
var services = new ServiceCollection()
.AddElsa(option => option.UsePersistence(db => db.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted)))
.AddElsa()
.AddConsoleActivities()
.BuildServiceProvider();

View file

@ -1,6 +1,8 @@
using System.Threading.Tasks;
using System.Data;
using System.Threading.Tasks;
using Elsa.Services;
using Microsoft.Extensions.DependencyInjection;
using YesSql.Provider.Sqlite;
namespace Elsa.Samples.HelloWorldConsole
{
@ -19,10 +21,10 @@ namespace Elsa.Samples.HelloWorldConsole
var startupRunner = services.GetRequiredService<IStartupRunner>();
await startupRunner.StartupAsync();
// Get a workflow host.
// Get a workflow runner.
var workflowRunner = services.GetService<IWorkflowRunner>();
// Execute the workflow.
// Run the workflow.
await workflowRunner.RunWorkflowAsync<HelloWorld>();
}
}

View file

@ -1,5 +1,4 @@
using Elsa.Activities.Console;
using Elsa.Activities.Primitives;
using Elsa.Builders;
using Elsa.Services;

View file

@ -14,7 +14,7 @@ namespace Elsa.Samples.ProgrammaticCompositeActivitiesConsole
{
// Create a service container with Elsa services.
var services = new ServiceCollection()
.AddElsa(option => option.UsePersistence(db => db.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted)))
.AddElsa()
.AddConsoleActivities()
.AddActivity<CountDownActivity>()
.AddWorkflow<CompositionWorkflow>()

View file

@ -24,7 +24,7 @@ namespace Elsa.Samples.Serialization
{
// Create a service container with Elsa services.
var services = new ServiceCollection()
.AddElsa(option => option.UsePersistence(db => db.UseSqLite("Data Source=elsa.db;Cache=Shared", IsolationLevel.ReadUncommitted)))
.AddElsa()
.AddConsoleActivities()
.BuildServiceProvider();