Restore faulty sample project

This commit is contained in:
Sipke Schoorstra 2021-06-08 20:30:51 +02:00
parent 150c93b8c6
commit 4eb3736bf5
5 changed files with 38 additions and 2 deletions

View file

@ -291,6 +291,8 @@ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElsaDashboard.Samples.BlazorServer", "src\samples\dashboard\blazor\ElsaDashboard.Samples.BlazorServer\ElsaDashboard.Samples.BlazorServer.csproj", "{6A03B177-09E0-4421-9704-945E6248AB69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Samples.FaultyWorkflows", "src\samples\aspnet\Elsa.Samples.FaultyWorkflows\Elsa.Samples.FaultyWorkflows.csproj", "{84751112-C2B7-41D4-98F5-D87D7C2E1DAE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -673,6 +675,10 @@ Global
{6A03B177-09E0-4421-9704-945E6248AB69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A03B177-09E0-4421-9704-945E6248AB69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A03B177-09E0-4421-9704-945E6248AB69}.Release|Any CPU.Build.0 = Release|Any CPU
{84751112-C2B7-41D4-98F5-D87D7C2E1DAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84751112-C2B7-41D4-98F5-D87D7C2E1DAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84751112-C2B7-41D4-98F5-D87D7C2E1DAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84751112-C2B7-41D4-98F5-D87D7C2E1DAE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -803,6 +809,7 @@ Global
{24A99602-F743-4B1A-AC96-599F34AE916C} = {D86B94DC-A53C-4A67-A820-828DD359C49B}
{8E6215AB-FDD3-4011-B598-B6BB63F294BB} = {4673732F-2853-47BD-91B8-C95C229D2C89}
{6A03B177-09E0-4421-9704-945E6248AB69} = {D86B94DC-A53C-4A67-A820-828DD359C49B}
{84751112-C2B7-41D4-98F5-D87D7C2E1DAE} = {22E75696-6FE9-436A-9097-EE21C603F818}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B0975FD-7050-48B0-88C5-48C33378E158}

View file

@ -6,7 +6,9 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />
<ProjectReference Include="..\..\..\persistence\Elsa.Persistence.EntityFramework\Elsa.Persistence.EntityFramework.Core\Elsa.Persistence.EntityFramework.Core.csproj" />
<ProjectReference Include="..\..\..\persistence\Elsa.Persistence.EntityFramework\Elsa.Persistence.EntityFramework.Sqlite\Elsa.Persistence.EntityFramework.Sqlite.csproj" />
</ItemGroup>

View file

@ -1,7 +1,7 @@
using Elsa.Persistence.EntityFramework.Core.Extensions;
using Elsa.Persistence.EntityFramework.Sqlite;
using Elsa.Samples.FaultyWorkflows.Workflows;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Samples.FaultyWorkflows
@ -12,7 +12,8 @@ namespace Elsa.Samples.FaultyWorkflows
{
services
.AddElsa(elsa => elsa
.UseEntityFrameworkPersistence(options => options.UseSqlite("Data Source=elsa.db;Cache=Shared;", db => db.MigrationsAssembly(typeof(SqliteElsaContextFactory).Assembly.GetName().Name)))
.UseEntityFrameworkPersistence(options => options.UseSqlite())
.AddConsoleActivities()
.AddHttpActivities()
.AddWorkflow<FaultyWorkflow>());
}

View file

@ -0,0 +1,19 @@
using System;
using System.Net.Http;
using Elsa.Activities.Console;
using Elsa.Activities.Http;
using Elsa.Builders;
namespace Elsa.Samples.FaultyWorkflows.Workflows
{
public class FaultyWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.HttpEndpoint(activity => activity.WithPath("/faulty").WithMethod(HttpMethod.Get.Method))
.WriteLine("Catch this!")
.Then(() => throw new ArithmeticException("Does not compute", new ArgumentException("Incorrect argument", new ArgumentOutOfRangeException("This is the root problem", default(Exception)))));
}
}
}

View file

@ -0,0 +1,7 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
}
}