Skip to content

Instantly share code, notes, and snippets.

@sfmskywalker
sfmskywalker / get-and-execute-workflow.cs
Created Sep 11, 2020
Get a workflow by ID and execute it
View get-and-execute-workflow.cs
using System;
using System.Threading;
using System.Threading.Tasks;
using Elsa.Models;
using Elsa.Services;
using Elsa.Services.Models;
using Microsoft.Extensions.DependencyInjection;
namespace Sample
{
@sfmskywalker
sfmskywalker / JsonWorkflowProvider.cs
Created Sep 11, 2020
Sample implementation of a JSON file-based workflow provider
View JsonWorkflowProvider.cs
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Elsa.Models;
using Elsa.Serialization;
using Elsa.Services;
using Microsoft.Extensions.Configuration;
@sfmskywalker
sfmskywalker / DeleteUser.cs
Created Nov 2, 2019
DeleteUser.cs - Building Workflow Driven .NET Core Applications with Elsa
View DeleteUser.cs
using System.Threading;
using System.Threading.Tasks;
using Elsa.Attributes;
using Elsa.Expressions;
using Elsa.Results;
using Elsa.Samples.UserRegistration.Web.Models;
using Elsa.Services;
using Elsa.Services.Models;
using MongoDB.Driver;
@sfmskywalker
sfmskywalker / ActivateUser.cs
Created Nov 2, 2019
ActivateUser.cs - Building Workflow Driven .NET Core Applications with Elsa
View ActivateUser.cs
using System.Threading;
using System.Threading.Tasks;
using Elsa.Attributes;
using Elsa.Expressions;
using Elsa.Results;
using Elsa.Samples.UserRegistration.Web.Models;
using Elsa.Services;
using Elsa.Services.Models;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
@sfmskywalker
sfmskywalker / CreateUser.cs
Last active Nov 2, 2019
CreateUser.cs - Building Workflow Driven .NET Core Applications with Elsa
View CreateUser.cs
using System.Threading;
using System.Threading.Tasks;
using Elsa.Attributes;
using Elsa.Expressions;
using Elsa.Extensions;
using Elsa.Results;
using Elsa.Samples.UserRegistration.Web.Models;
using Elsa.Samples.UserRegistration.Web.Services;
using Elsa.Services;
using Elsa.Services.Models;
@sfmskywalker
sfmskywalker / UserServiceCollectionExtensions.cs
Created Nov 2, 2019
UserServiceCollectionExtensions.cs - Building Workflow Driven .NET Core Applications with Elsa
View UserServiceCollectionExtensions.cs
using Elsa.Samples.UserRegistration.Web.Activities;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Samples.UserRegistration.Web.Extensions
{
public static class UserServiceCollectionExtensions
{
public static IServiceCollection AddUserActivities(this IServiceCollection services)
{
return services
@sfmskywalker
sfmskywalker / LiquidConfigurationHandler.cs
Created Nov 2, 2019
LiquidConfigurationHandler.cs - Building Workflow Driven .NET Core Applications with Elsa
View LiquidConfigurationHandler.cs
using System.Threading;
using System.Threading.Tasks;
using Elsa.Samples.UserRegistration.Web.Models;
using Elsa.Scripting.Liquid.Messages;
using Fluid;
using MediatR;
namespace Elsa.Samples.UserRegistration.Web.Handlers
{
/// <summary>
@sfmskywalker
sfmskywalker / HashedPassword.cs
Last active Nov 2, 2019
HashedPassword.cs - Building Workflow Driven .NET Core Applications with Elsa
View HashedPassword.cs
using System;
namespace Elsa.Samples.UserRegistration.Web.Models
{
public class HashedPassword
{
public HashedPassword(byte[] hashed, byte[] salt)
{
Hashed = Convert.ToBase64String(hashed);
Salt = Convert.ToBase64String(salt);
@sfmskywalker
sfmskywalker / PasswordHasher.cs
Created Nov 2, 2019
PasswordHasher.cs - Building Workflow Driven .NET Core Applications with Elsa
View PasswordHasher.cs
using System.Security.Cryptography;
using Elsa.Samples.UserRegistration.Web.Models;
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
namespace Elsa.Samples.UserRegistration.Web.Services
{
public class PasswordHasher : IPasswordHasher
{
public HashedPassword HashPassword(string password)
{
@sfmskywalker
sfmskywalker / IPasswordHasher.cs
Created Nov 2, 2019
IPasswordHasher.cs - Building Workflow Driven .NET Core Applications with Elsa
View IPasswordHasher.cs
using Elsa.Samples.UserRegistration.Web.Models;
namespace Elsa.Samples.UserRegistration.Web.Services
{
public interface IPasswordHasher
{
HashedPassword HashPassword(string password);
HashedPassword HashPassword(string password, byte[] salt);
}
}
You can’t perform that action at this time.