Skip to content

Instantly share code, notes, and snippets.

@sfmskywalker
sfmskywalker / Index.razor
Last active Nov 3, 2019
Index.razor - Building Workflow Driven .NET Core Applications with Elsa
View Index.razor
@page "/"
<div class="form-signup">
<EditForm Model="@RegistrationModel" OnValidSubmit="@HandleFormSubmission" hidden="@ShowConfirmation">
<h1 class="h3 mb-3 font-weight-normal">Please register</h1>
<DataAnnotationsValidator/>
<ValidationSummary/>
@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);
}
}
@sfmskywalker
sfmskywalker / appsettings.json
Created Nov 2, 2019
appsettings.json - Building Workflow Driven .NET Core Applications with Elsa
View appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
You can’t perform that action at this time.