parent
b01c4ef7fa
commit
f44d7e12b9
|
|
@ -2,12 +2,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Elsa.Serialization.Handlers;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NodaTime;
|
||||
using NodaTime.Serialization.JsonNet;
|
||||
using NodaTime.Text;
|
||||
|
||||
namespace Elsa.Converters
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Primitives" Version="3.1.1" />
|
||||
|
|
|
|||
12
src/core/Elsa.Abstractions/Services/IMapper.cs
Normal file
12
src/core/Elsa.Abstractions/Services/IMapper.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace Elsa.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Maps source values to destination values.
|
||||
/// </summary>
|
||||
public interface IMapper
|
||||
{
|
||||
TDestination Map<TSource, TDestination>(TSource source);
|
||||
TDestination Map<TSource, TDestination>(TSource source, TDestination destination);
|
||||
TDestination Map<TDestination>(object source);
|
||||
}
|
||||
}
|
||||
8
src/core/Elsa.Abstractions/Services/MappingProfile.cs
Normal file
8
src/core/Elsa.Abstractions/Services/MappingProfile.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
using AutoMapper;
|
||||
|
||||
namespace Elsa.Services
|
||||
{
|
||||
public abstract class MappingProfile : Profile
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
using System;
|
||||
using AutoMapper;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
namespace Elsa.Extensions
|
||||
{
|
||||
public static class AutoMapperServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddAutoMapper(this IServiceCollection services, ServiceLifetime lifetime)
|
||||
{
|
||||
services.TryAddSingleton(CreateConfigurationProvider);
|
||||
services.TryAdd(new ServiceDescriptor(typeof(IMapper), sp => sp.GetRequiredService<IConfigurationProvider>().CreateMapper(sp.GetService), lifetime));
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddAutoMapperProfile<TProfile>(this IServiceCollection services, ServiceLifetime lifetime) where TProfile : Profile
|
||||
{
|
||||
services.AddAutoMapper(lifetime);
|
||||
services.TryAddProvider<Profile, TProfile>(lifetime);
|
||||
return services;
|
||||
}
|
||||
|
||||
private static IConfigurationProvider CreateConfigurationProvider(IServiceProvider serviceProvider)
|
||||
{
|
||||
var profiles = serviceProvider.GetServices<Profile>();
|
||||
|
||||
var configuration = new MapperConfiguration(
|
||||
x =>
|
||||
{
|
||||
foreach (var profile in profiles)
|
||||
x.AddProfile(profile);
|
||||
}
|
||||
);
|
||||
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using Elsa;
|
||||
using Elsa.Activities;
|
||||
using Elsa.AutoMapper.Extensions;
|
||||
using Elsa.Caching;
|
||||
using Elsa.Expressions;
|
||||
using Elsa.Extensions;
|
||||
|
|
@ -88,7 +87,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
.AddTransient<IWorkflowProvider, CodeWorkflowProvider>()
|
||||
.AddTransient<IWorkflowBuilder, WorkflowBuilder>()
|
||||
.AddTransient<Func<IWorkflowBuilder>>(sp => sp.GetRequiredService<IWorkflowBuilder>)
|
||||
.AddAutoMapperProfile<WorkflowDefinitionProfile>(ServiceLifetime.Singleton)
|
||||
.AddMapperProfile<WorkflowDefinitionProfile>(ServiceLifetime.Singleton)
|
||||
.AddPrimitiveActivities();
|
||||
|
||||
return configuration;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using Elsa.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
namespace Elsa.Extensions
|
||||
{
|
||||
public static class MapperServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddMapper(this IServiceCollection services, ServiceLifetime lifetime)
|
||||
{
|
||||
services.TryAddSingleton(CreateMapper);
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddMapperProfile<TProfile>(this IServiceCollection services, ServiceLifetime lifetime) where TProfile : MappingProfile
|
||||
{
|
||||
services.AddMapper(lifetime);
|
||||
services.TryAddProvider<MappingProfile, TProfile>(lifetime);
|
||||
return services;
|
||||
}
|
||||
|
||||
private static IMapper CreateMapper(IServiceProvider services)
|
||||
{
|
||||
var profiles = services.GetServices<MappingProfile>();
|
||||
return new AutoMapperMapper(profiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
using System;
|
||||
using AutoMapper;
|
||||
using Elsa.Services;
|
||||
using NodaTime;
|
||||
|
||||
namespace Elsa.AutoMapper.Extensions.NodaTime
|
||||
namespace Elsa.Mapping
|
||||
{
|
||||
public class NodaTimeProfile : Profile,
|
||||
public class NodaTimeProfile : MappingProfile,
|
||||
ITypeConverter<Instant, DateTime>,
|
||||
ITypeConverter<Instant?, DateTime?>,
|
||||
ITypeConverter<DateTime, Instant>,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Services;
|
||||
|
||||
namespace Elsa.Mapping
|
||||
{
|
||||
public class WorkflowDefinitionProfile : Profile
|
||||
public sealed class WorkflowDefinitionProfile : MappingProfile
|
||||
{
|
||||
public WorkflowDefinitionProfile()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Hosting.Server;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Elsa.Runtime
|
||||
|
|
|
|||
32
src/core/Elsa.Core/Services/AutoMapperMapper.cs
Normal file
32
src/core/Elsa.Core/Services/AutoMapperMapper.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
|
||||
namespace Elsa.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// A Mapper implementation that uses AutoMapper.
|
||||
/// Using a privately constructed AutoMapper.IMapper instance prevents collisions with other frameworks such as ABP.
|
||||
/// See https://github.com/elsa-workflows/elsa-core/issues/290
|
||||
/// </summary>
|
||||
public class AutoMapperMapper : IMapper
|
||||
{
|
||||
private readonly AutoMapper.IMapper mapper;
|
||||
|
||||
public AutoMapperMapper(IEnumerable<MappingProfile> profiles)
|
||||
{
|
||||
var configuration = new MapperConfiguration(
|
||||
x =>
|
||||
{
|
||||
foreach (var profile in profiles)
|
||||
x.AddProfile(profile);
|
||||
}
|
||||
);
|
||||
|
||||
mapper = configuration.CreateMapper();
|
||||
}
|
||||
|
||||
public TDestination Map<TSource, TDestination>(TSource source) => mapper.Map<TSource, TDestination>(source);
|
||||
public TDestination Map<TSource, TDestination>(TSource source, TDestination destination) => mapper.Map(source, destination);
|
||||
public TDestination Map<TDestination>(object source) => mapper.Map<TDestination>(source);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Elsa.Activities.ControlFlow.Extensions;
|
|||
using Elsa.Activities.UserTask.Extensions;
|
||||
using Elsa.Activities.Workflows.Extensions;
|
||||
using Elsa.Runtime;
|
||||
using Elsa.Scripting.JavaScript.Extensions;
|
||||
using Elsa.Scripting.Liquid.Extensions;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
using System;
|
||||
using Elsa.AutoMapper.Extensions;
|
||||
using Elsa.Dashboard.ActionFilters;
|
||||
using Elsa.Dashboard.Options;
|
||||
using Elsa.Dashboard.Services;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Mapping;
|
||||
using Elsa.Runtime;
|
||||
using Elsa.Serialization;
|
||||
using Elsa.Serialization.Formatters;
|
||||
using Elsa.Services;
|
||||
|
|
@ -61,7 +59,7 @@ namespace Elsa.Dashboard.Extensions
|
|||
.AddScoped<IWorkflowPublisher, WorkflowPublisher>()
|
||||
.AddScoped<INotifier, Notifier>()
|
||||
.AddScoped<NotifierFilter>()
|
||||
.AddAutoMapperProfile<WorkflowDefinitionProfile>(ServiceLifetime.Singleton);
|
||||
.AddMapperProfile<WorkflowDefinitionProfile>(ServiceLifetime.Singleton);
|
||||
|
||||
services.AddScoped(
|
||||
sp =>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using System;
|
||||
using Elsa.Persistence.DocumentDb.Services;
|
||||
using Elsa.AutoMapper.Extensions;
|
||||
using Elsa.AutoMapper.Extensions.NodaTime;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Mapping;
|
||||
using Elsa.Persistence.DocumentDb.Mapping;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
|
|
@ -25,8 +24,8 @@ namespace Elsa.Persistence.DocumentDb.Extensions
|
|||
|
||||
builder.Services
|
||||
.AddSingleton(storage)
|
||||
.AddAutoMapperProfile<NodaTimeProfile>(ServiceLifetime.Singleton)
|
||||
.AddAutoMapperProfile<DocumentProfile>(ServiceLifetime.Singleton);
|
||||
.AddMapperProfile<NodaTimeProfile>(ServiceLifetime.Singleton)
|
||||
.AddMapperProfile<DocumentProfile>(ServiceLifetime.Singleton);
|
||||
|
||||
return new CosmosDbElsaBuilder(builder.Services);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.DocumentDb.Documents;
|
||||
using Elsa.Services;
|
||||
|
||||
namespace Elsa.Persistence.DocumentDb.Mapping
|
||||
{
|
||||
public class DocumentProfile : Profile
|
||||
public sealed class DocumentProfile : MappingProfile
|
||||
{
|
||||
public DocumentProfile()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.DocumentDb.Documents;
|
||||
using Elsa.Persistence.DocumentDb.Extensions;
|
||||
using Elsa.Persistence.DocumentDb.Helpers;
|
||||
using Elsa.Services;
|
||||
|
||||
namespace Elsa.Persistence.DocumentDb.Services
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.DocumentDb.Documents;
|
||||
using Elsa.Persistence.DocumentDb.Helpers;
|
||||
using Elsa.Services;
|
||||
|
||||
namespace Elsa.Persistence.DocumentDb.Services
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using System.Collections.Generic;
|
|||
using Elsa.Models;
|
||||
using Elsa.Persistence.EntityFrameworkCore.CustomSchema;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Entities;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using Elsa.AutoMapper.Extensions;
|
||||
using Elsa.AutoMapper.Extensions.NodaTime;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Mapping;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Mapping;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Services;
|
||||
|
|
@ -25,8 +24,8 @@ namespace Elsa.Persistence.EntityFrameworkCore.Extensions
|
|||
services.AddDbContext<ElsaContext, TElsaContext>(configureOptions);
|
||||
|
||||
services
|
||||
.AddAutoMapperProfile<NodaTimeProfile>(ServiceLifetime.Singleton)
|
||||
.AddAutoMapperProfile<EntitiesProfile>(ServiceLifetime.Singleton);
|
||||
.AddMapperProfile<NodaTimeProfile>(ServiceLifetime.Singleton)
|
||||
.AddMapperProfile<EntitiesProfile>(ServiceLifetime.Singleton);
|
||||
|
||||
return new EntityFrameworkCoreElsaBuilder(configuration.Services);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@ using System.Linq;
|
|||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Entities;
|
||||
using Elsa.Services;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Mapping
|
||||
{
|
||||
public class EntitiesProfile : Profile
|
||||
public class EntitiesProfile : MappingProfile
|
||||
{
|
||||
public EntitiesProfile()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using System;
|
|||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Migrations.MySql
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using System;
|
|||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Migrations.PostgreSql
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Migrations.SqlServer
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using System;
|
|||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Migrations.Sqlite
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Entities;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Extensions;
|
||||
using Elsa.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Services
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Entities;
|
||||
using Elsa.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Elsa.Persistence.EntityFrameworkCore.Services
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using Elsa.AutoMapper.Extensions;
|
||||
using Elsa.AutoMapper.Extensions.NodaTime;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Mapping;
|
||||
using Elsa.Persistence.YesSql.Indexes;
|
||||
using Elsa.Persistence.YesSql.Mapping;
|
||||
using Elsa.Persistence.YesSql.Schema;
|
||||
|
|
@ -26,8 +25,8 @@ namespace Elsa.Persistence.YesSql.Extensions
|
|||
.AddSingleton<IIndexProvider, WorkflowInstanceIndexProvider>()
|
||||
.AddTransient<ISchemaVersionStore, SchemaVersionStore>()
|
||||
.AddScoped(CreateSession)
|
||||
.AddAutoMapperProfile<NodaTimeProfile>(ServiceLifetime.Singleton)
|
||||
.AddAutoMapperProfile<DocumentProfile>(ServiceLifetime.Singleton)
|
||||
.AddMapperProfile<NodaTimeProfile>(ServiceLifetime.Singleton)
|
||||
.AddMapperProfile<DocumentProfile>(ServiceLifetime.Singleton)
|
||||
.AddStartupTask<InitializeStoreTask>();
|
||||
|
||||
return new YesSqlElsaBuilder(configuration.Services);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.YesSql.Documents;
|
||||
using Elsa.Services;
|
||||
|
||||
namespace Elsa.Persistence.YesSql.Mapping
|
||||
{
|
||||
public class DocumentProfile : Profile
|
||||
public class DocumentProfile : MappingProfile
|
||||
{
|
||||
public DocumentProfile()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.YesSql.Documents;
|
||||
using Elsa.Persistence.YesSql.Extensions;
|
||||
using Elsa.Persistence.YesSql.Indexes;
|
||||
using Elsa.Services;
|
||||
using YesSql;
|
||||
|
||||
namespace Elsa.Persistence.YesSql.Services
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.YesSql.Documents;
|
||||
using Elsa.Persistence.YesSql.Indexes;
|
||||
using Elsa.Services;
|
||||
using YesSql;
|
||||
|
||||
namespace Elsa.Persistence.YesSql.Services
|
||||
|
|
@ -26,15 +26,15 @@ namespace Elsa.Persistence.YesSql.Services
|
|||
public async Task<WorkflowInstance> SaveAsync(WorkflowInstance instance, CancellationToken cancellationToken)
|
||||
{
|
||||
string instanceId = instance.Id;
|
||||
|
||||
|
||||
WorkflowInstanceDocument existingInstance = await session
|
||||
.Query<WorkflowInstanceDocument, WorkflowInstanceIndex>(x => x.WorkflowInstanceId == instanceId)
|
||||
.FirstOrDefaultAsync();
|
||||
.Query<WorkflowInstanceDocument, WorkflowInstanceIndex>(x => x.WorkflowInstanceId == instanceId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
WorkflowInstanceDocument document = (existingInstance != null)
|
||||
? mapper.Map(instance, existingInstance)
|
||||
: mapper.Map<WorkflowInstanceDocument>(instance);
|
||||
|
||||
|
||||
session.Save(document);
|
||||
await session.CommitAsync();
|
||||
return mapper.Map<WorkflowInstance>(document);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.Activities.Console.Extensions;
|
||||
using Elsa.Extensions;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Elsa.Activities.Email.Extensions;
|
||||
using Elsa.Activities.Http.Extensions;
|
||||
using Elsa.Activities.Timers.Extensions;
|
||||
using Elsa.Runtime;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
using Elsa.Activities.Http.Extensions;
|
||||
using Elsa.Activities.MassTransit.Extensions;
|
||||
using Elsa.Activities.Timers.Extensions;
|
||||
using Elsa.Runtime;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using Elsa.Persistence.EntityFrameworkCore;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using Elsa.Persistence.EntityFrameworkCore;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Elsa.Activities.Console.Extensions;
|
|||
using Elsa.Extensions;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence;
|
||||
using Elsa.Persistence.EntityFrameworkCore;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Extensions;
|
||||
using Elsa.Runtime;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.IO;
|
||||
using System.Net.Mail;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.Activities.Console.Extensions;
|
||||
using Elsa.Activities.Email.Extensions;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using Elsa;
|
||||
using Elsa.Activities;
|
||||
using Elsa.Activities.Console.Activities;
|
||||
|
|
@ -40,7 +40,7 @@ namespace Sample20.Workflows
|
|||
x.ValueExpression = new JavaScriptExpression<string>("'Test'");
|
||||
})
|
||||
.Then<ForEach>(
|
||||
x => x.CollectionExpression = new JavaScriptExpression<IList<object>>("[Customer1, Customer2, Customer3]"),
|
||||
x => x.CollectionExpression = new JavaScriptExpression<IList>("[Customer1, Customer2, Customer3]"),
|
||||
forEach =>
|
||||
{
|
||||
forEach
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Elsa.Activities.Email.Extensions;
|
|||
using Elsa.Activities.Http.Extensions;
|
||||
using Elsa.Activities.MassTransit.Extensions;
|
||||
using Elsa.Activities.Timers.Extensions;
|
||||
using Elsa.Runtime;
|
||||
using GreenPipes;
|
||||
using MassTransit;
|
||||
using MassTransit.ExtensionsDependencyInjectionIntegration;
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ using Elsa.Activities.Console.Extensions;
|
|||
using Elsa.Extensions;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence;
|
||||
using Elsa.Persistence.EntityFrameworkCore;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Extensions;
|
||||
using Elsa.Runtime;
|
||||
using Elsa.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Elsa;
|
||||
using Elsa.Persistence.EntityFrameworkCore.CustomSchema;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ namespace Sample23
|
|||
public void Build(IWorkflowBuilder builder)
|
||||
{
|
||||
builder
|
||||
.WithVersion(1)
|
||||
.StartWith<WriteLine>(activity => activity.TextExpression = new LiteralExpression("Hello World!"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using System;
|
|||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace Sample23.Migrations
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@ using Elsa.Activities.Console.Extensions;
|
|||
using Elsa.Extensions;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence;
|
||||
using Elsa.Persistence.EntityFrameworkCore;
|
||||
using Elsa.Persistence.EntityFrameworkCore.CustomSchema;
|
||||
using Elsa.Persistence.EntityFrameworkCore.DbContexts;
|
||||
using Elsa.Persistence.EntityFrameworkCore.Extensions;
|
||||
using Elsa.Runtime;
|
||||
using Elsa.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Sample23
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
|||
using Elsa.Scripting.JavaScript.Messages;
|
||||
using MediatR;
|
||||
using NodaTime;
|
||||
using NodaTime.Text;
|
||||
|
||||
namespace Elsa.Scripting.JavaScript.Handlers
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using System.Dynamic;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Elsa.Expressions;
|
||||
using Elsa.Scripting.JavaScript.Converters;
|
||||
using Elsa.Scripting.JavaScript.Extensions;
|
||||
|
|
@ -25,7 +24,6 @@ namespace Elsa.Scripting.JavaScript.Services
|
|||
public class JavaScriptExpressionEvaluator : IExpressionEvaluator
|
||||
{
|
||||
private readonly IMediator mediator;
|
||||
private readonly IMapper mapper;
|
||||
private readonly IOptions<ScriptOptions> options;
|
||||
private readonly JsonSerializerSettings serializerSettings;
|
||||
public const string SyntaxName = "JavaScript";
|
||||
|
|
@ -38,7 +36,6 @@ namespace Elsa.Scripting.JavaScript.Services
|
|||
public JavaScriptExpressionEvaluator(IMediator mediator, IMapper mapper, IOptions<ScriptOptions> options)
|
||||
{
|
||||
this.mediator = mediator;
|
||||
this.mapper = mapper;
|
||||
this.options = options;
|
||||
|
||||
serializerSettings = new JsonSerializerSettings().ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
|
||||
|
|
|
|||
Loading…
Reference in a new issue