Path: redb/redb.Tests.Integration/Tests/Unit/RedbListItemSerializationTests.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/Tests/Unit/RedbListItemSerializationTests.cs ---- using System.Text.Json; using redb.Core.Models.Entities; namespace redb.Tests.Integration.Tests.Unit; /// /// is a lazy load behind a property getter. A serializer walking /// public properties must not wake it: that is how an audit log or an HTTP response ends up issuing /// database loads (a production report, 2026-09). /// /// No redb scope is live here: a read of Object would throw (a lazy load runs on the reader's scope, owner decision /// 2026-09-15) or, under a configured fresh scope, leave the item loaded - both are caught. /// /// [Collection("RedbListItemSerialization")] public class RedbListItemSerializationTests { [Fact] public void SystemTextJson_DoesNotWakeTheLazyObjectLoader() { var item = new RedbListItem { Id = 1, IdList = 2, Value = "v", IdObject = 42 }; var json = JsonSerializer.Serialize(item); item.IsObjectLoaded.Should().BeFalse("serialization is not a request to load the linked object"); json.Should().NotContain("\"object\""); json.Should().Contain("\"id_object\":42"); } }