Path: redb/redb.Tests.Integration/Models/ModuleUnloadModels.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Tests.Integration/Models/ModuleUnloadModels.cs
----
using redb.Core.Attributes;
using redb.Core.Interception;
namespace redb.Tests.Integration.Models;
///
/// The Props type of a "module": the module unload test loads this assembly again into a collectible
/// AssemblyLoadContext and works with the copy of this type found there.
///
[RedbScheme(Name = "test.module_unload")]
public class ModuleUnloadProps
{
public string Title { get; set; } = "";
}
/// The save interceptor of the "module" (see ).
public sealed class ModuleUnloadInterceptor : IRedbSaveInterceptor
{
public int Saved;
public int Deleted;
public Task SavedAsync(RedbSavedContext context, CancellationToken cancellationToken = default)
{
Interlocked.Increment(ref Saved);
return Task.CompletedTask;
}
public Task DeletedAsync(RedbDeletedContext context, CancellationToken cancellationToken = default)
{
Interlocked.Increment(ref Deleted);
return Task.CompletedTask;
}
}