Upgrade Quartz and some warning fixes (#5949)
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
This commit is contained in:
parent
290eb9fe19
commit
12f947cf9b
|
|
@ -28,9 +28,13 @@
|
|||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<NoWarn>$(NoWarn);CS0162;CS1591</NoWarn>
|
||||
<!-- IL trimming warnings -->
|
||||
<NoWarn>$(NoWarn);IL2026;IL2046;IL2057;IL2067;IL2070;IL2072;IL2075;IL2087;IL2091</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ElsaStudioVersion>3.3.0-preview.470</ElsaStudioVersion>
|
||||
|
|
|
|||
|
|
@ -82,10 +82,8 @@
|
|||
<PackageVersion Include="Proto.Persistence.SqlServer" Version="1.6.0" />
|
||||
<PackageVersion Include="Proto.Remote" Version="1.6.0" />
|
||||
<PackageVersion Include="pythonnet" Version="3.0.3" />
|
||||
<PackageVersion Include="Quartz" Version="3.11.0" />
|
||||
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.11.0" />
|
||||
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.11.0" />
|
||||
<PackageVersion Include="Quartz.Serialization.Json" Version="3.11.0" />
|
||||
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.13.0" />
|
||||
<PackageVersion Include="Quartz.Serialization.Json" Version="3.13.0" />
|
||||
<PackageVersion Include="Refit" Version="7.1.2" />
|
||||
<PackageVersion Include="Refit.HttpClientFactory" Version="7.0.0" />
|
||||
<PackageVersion Include="Scrutor" Version="4.2.2" />
|
||||
|
|
|
|||
|
|
@ -17,12 +17,16 @@ public static class PropertyBagExtensions
|
|||
/// <param name="key">The key of the value to retrieve.</param>
|
||||
/// <param name="defaultValue">A function that returns the default value to be returned if the key does not exist in the PropertyBag.</param>
|
||||
/// <returns>The value associated with the key, or the default value if the key does not exist.</returns>
|
||||
public static T TryGetValueOrDefault<T>(this PropertyBag propertyBag, string key, Func<T> defaultValue)
|
||||
public static T? TryGetValueOrDefault<T>(this PropertyBag propertyBag, string key, Func<T> defaultValue)
|
||||
{
|
||||
if (!propertyBag.TryGetValue(key, out var value))
|
||||
return defaultValue();
|
||||
|
||||
var json = value.ToString();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
return defaultValue();
|
||||
|
||||
return JsonSerializer.Deserialize<T>(json);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ public class DefaultFormattersFeature(IModule module) : FeatureBase(module)
|
|||
{
|
||||
public override void Configure()
|
||||
{
|
||||
module.Services.AddSingleton<IFormatter, JsonFormatter>();
|
||||
Module.Services.AddSingleton<IFormatter, JsonFormatter>();
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ namespace Elsa.Common.Results;
|
|||
/// <summary>
|
||||
/// Represents the result of a tenant resolution.
|
||||
/// </summary>
|
||||
/// <param name="Tenant">The resolved tenant.</param>
|
||||
/// <param name="TenantId">The resolved tenant.</param>
|
||||
public record TenantResolutionResult(string? TenantId)
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class StandardJsonSerializer : ConfigurableSerializer, IJsonSerializer
|
|||
|
||||
/// <inheritdoc />
|
||||
[RequiresUnreferencedCode("The type is not known at compile time.")]
|
||||
public string Serialize(object value, Type type)
|
||||
public string Serialize(object? value, Type type)
|
||||
{
|
||||
var options = GetOptions();
|
||||
return JsonSerializer.Serialize(value, type, options);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public abstract class DesignTimeDbContextFactoryBase<TDbContext> : IDesignTimeDb
|
|||
|
||||
ConfigureBuilder(builder, connectionString);
|
||||
|
||||
return (TDbContext)Activator.CreateInstance(typeof(TDbContext), builder.Options, serviceProvider);
|
||||
return (TDbContext)Activator.CreateInstance(typeof(TDbContext), builder.Options, serviceProvider)!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class DbSchemaAwareMigrationAssembly : MigrationsAssembly
|
|||
|
||||
if (hasCtorWithSchema && _context is IElsaDbContextSchema schema)
|
||||
{
|
||||
var instance = (Migration)Activator.CreateInstance(migrationClass.AsType(), schema);
|
||||
var instance = (Migration)Activator.CreateInstance(migrationClass.AsType(), schema)!;
|
||||
instance.ActiveProvider = activeProvider;
|
||||
return instance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Elsa.Extensions;
|
|||
public static class ExpressionOptionsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Register type <see cref="T"/> with the specified alias.
|
||||
/// Register type <typeparamref name="T"/> with the specified alias.
|
||||
/// </summary>
|
||||
public static void AddTypeAlias<T>(this ExpressionOptions options) => options.RegisterTypeAlias(typeof(T), typeof(T).Name);
|
||||
public static void AddTypeAlias<T>(this ExpressionOptions options, string alias) => options.RegisterTypeAlias(typeof(T), alias);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public static class ModuleExtensions
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register type <see cref="T"/> with the specified alias.
|
||||
/// Register type <typeparamref name="T"/> with the specified alias.
|
||||
/// </summary>
|
||||
/// <param name="module">The module.</param>
|
||||
/// <param name="alias">The alias.</param>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Elsa.Expressions.Extensions;
|
|||
public static class WellKnowTypeRegistryExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Register type <see cref="T"/> with the specified alias.
|
||||
/// Register type <typeparamref name="T"/> with the specified alias.
|
||||
/// </summary>
|
||||
public static void RegisterType<T>(this IWellKnownTypeRegistry registry, string alias) => registry.RegisterType(typeof(T), alias);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public partial class Expression
|
|||
/// Creates an expression that represents a delegate.
|
||||
/// </summary>
|
||||
/// <param name="value">The delegate.</param>
|
||||
/// <typeparam name="T">The return type of the delegate.</typeparam>
|
||||
/// <returns>An expression that represents a delegate.</returns>
|
||||
public static Expression DelegateExpression(Func<ExpressionExecutionContext, ValueTask<object?>> value) => new()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Quartz" />
|
||||
<PackageReference Include="Quartz.Extensions.DependencyInjection" />
|
||||
<PackageReference Include="Quartz.Extensions.Hosting" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,6 @@ public class QuartzFeature : FeatureBase
|
|||
|
||||
private static void ConfigureQuartzInternal(IServiceCollectionQuartzConfigurator quartz, Action<IServiceCollectionQuartzConfigurator>? configureQuartz)
|
||||
{
|
||||
quartz.UseMicrosoftDependencyInjectionJobFactory();
|
||||
quartz.UseSimpleTypeLoader();
|
||||
quartz.UseInMemoryStore();
|
||||
configureQuartz?.Invoke(quartz);
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ namespace Elsa.Tenants.Extensions;
|
|||
public static class ModuleExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Installs & configures the <see cref="TenantsFeature"/> feature.
|
||||
/// Installs and configures the <see cref="TenantsFeature"/> feature.
|
||||
/// </summary>
|
||||
public static IModule UseTenants(this IModule module, Action<TenantsFeature>? configure = default)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -280,7 +280,8 @@ public partial class WorkflowExecutionContext : IExecutionContext
|
|||
public Diff<Bookmark> BookmarksDiff => Diff.For(OriginalBookmarks, Bookmarks);
|
||||
|
||||
/// <summary>
|
||||
/// A dictionary of inputs provided at the start of the current workflow execution.
|
||||
/// A dictionary of inputs provided at the start of the current workflow execution.
|
||||
/// </summary>
|
||||
public IDictionary<string, object> Input { get; set; }
|
||||
|
||||
/// A dictionary of outputs provided by the current workflow execution.
|
||||
|
|
@ -398,6 +399,7 @@ public partial class WorkflowExecutionContext : IExecutionContext
|
|||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="ActivityNode"/> with the specified activity ID from the workflow graph.
|
||||
/// </summary>
|
||||
public ActivityNode? FindNodeById(string nodeId) => NodeIdLookup.TryGetValue(nodeId, out var node) ? node : default;
|
||||
|
||||
/// Returns the <see cref="ActivityNode"/> with the specified hash of the activity node ID from the workflow graph.
|
||||
|
|
|
|||
Loading…
Reference in a new issue