This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Do some work every minute. | |
protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
{ | |
while(!stoppingToken.IsCancellationRequested) | |
{ | |
// Do work. | |
// Wait for a minute. | |
await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
{ |