Path: redb/redb.Tests.Integration/Models/IgnoredGetterProbeModels.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/IgnoredGetterProbeModels.cs
----
using System.Collections.Concurrent;
using redb.Core.Attributes;
using redb.Core.Models.Entities;
namespace redb.Tests.Integration.Models;
///
/// Props with references and two [RedbIgnore] properties whose getters count their reads per object label, so
/// suites running in parallel on several hosts never share a count. One property has a setter: the Pro reference
/// substitution walks read-write properties only.
///
public class IgnoredGetterProbeProps
{
public static readonly ConcurrentDictionary TechnicalReads = new();
private string? _settable;
public string? Label { get; set; }
public List>? Refs { get; set; }
[RedbIgnore]
public string Technical
{
get { CountRead(); return "technical"; }
}
[RedbIgnore]
public string? TechnicalSettable
{
get { CountRead(); return _settable; }
set => _settable = value;
}
private void CountRead() => TechnicalReads.AddOrUpdate(Label ?? "", 1, (_, n) => n + 1);
}