add Uri parser, add ISerializationBinder

ISerializationBinder is added only in whitelist mode. Types for whitelisting should be registered manually via new API `Module.StartAsync()` or attribute `AllowedSerializableType(name)`
This commit is contained in:
2024-05-29 00:19:30 +03:00
parent af8efcbf4a
commit 920148e05b
7 changed files with 149 additions and 2 deletions
+6 -1
View File
@@ -2,6 +2,8 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Threading;
using System.Threading.Tasks;
namespace Kruzya.TelegramBot.Core;
@@ -22,7 +24,10 @@ public abstract class Module
public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
}
public virtual Task StartAsync(CancellationToken cts, IServiceScope scope) => Task.CompletedTask;
public virtual Task StopAsync(CancellationToken cts, IServiceScope scope) => Task.CompletedTask;
/// <summary>
/// Ensures if module is loaded and started. Note that call can change module event chain.
/// </summary>