Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Polecat/DocumentStore.EventStoreExplorer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text.Json;
using JasperFx.Descriptors;
Expand All @@ -17,6 +18,12 @@ namespace Polecat;
/// Implements the eight methods added in JasperFx.Events 1.36 against
/// Polecat's pc_streams / pc_events / pc_event_progression tables.
/// </summary>
[UnconditionalSuppressMessage("Trimming", "IL2075:DynamicallyAccessedMembers",
Justification = "Class-level: RehydrateAtVersionByNameAsync reflects on Task<T>.Result + .State/.Version/.EventsApplied properties of the returned strong-typed result. The framework Task<TResult> intrinsic and the strong-typed result type are preserved by the registered projection boundary.")]
[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "Class-level: invokes ISerializer.ToJson, which is annotated RUC because the default STJ-reflection serializer requires unreferenced code. AOT consumers supply a source-generator-backed ISerializer impl per the AOT publishing guide.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode",
Justification = "Class-level: RehydrateAtVersionByNameAsync uses MethodInfo.MakeGenericMethod with the resolved aggregate type — runtime code generation. AOT consumers should prefer the strong-typed RehydrateAtVersionAsync<T> overload (covered by the AOT publishing guide).")]
public partial class DocumentStore
{
async Task<IReadOnlyList<StreamSummary>> IEventStore.GetRecentStreamsAsync(
Expand Down
5 changes: 5 additions & 0 deletions src/Polecat/Internal/DocumentProvider.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using JasperFx;
using Polecat.Internal.Operations;
using Polecat.Metadata;
Expand All @@ -11,6 +12,10 @@ namespace Polecat.Internal;
/// Per-document-type factory for storage operations. Caches the DocumentMapping
/// and generates SQL operations for a specific type.
/// </summary>
[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "Class-level: invokes ISerializer.ToJson, which is annotated RUC because the default STJ-reflection serializer requires unreferenced code. AOT consumers supply a source-generator-backed ISerializer impl per the AOT publishing guide.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode",
Justification = "Class-level: ISerializer.ToJson is annotated RDC for the same reason as IL2026 above. AOT consumers supply a source-generator-backed ISerializer impl.")]
internal class DocumentProvider
{
public DocumentProvider(DocumentMapping mapping)
Expand Down
3 changes: 3 additions & 0 deletions src/Polecat/Internal/DocumentProviderRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Polecat.Schema.Identity.Sequences;
using Polecat.Storage;
Expand All @@ -9,6 +10,8 @@ namespace Polecat.Internal;
/// Thread-safe registry of DocumentProviders, one per document type.
/// Lazily creates mappings and providers on first access.
/// </summary>
[UnconditionalSuppressMessage("Trimming", "IL2075:DynamicallyAccessedMembers",
Justification = "Class-level: reads SubClasses/Indexes/ForeignKeys non-public fields off DocumentMappingExpression<T> via reflection. The expression type and fields are preserved by the registration boundary (Schema.For<T>()), where T flows in from caller code that trimming sees.")]
internal class DocumentProviderRegistry
{
private readonly ConcurrentDictionary<Type, DocumentProvider> _providers = new();
Expand Down
5 changes: 5 additions & 0 deletions src/Polecat/Storage/DocumentMapping.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using JasperFx;
using JasperFx.Core.Reflection;
Expand All @@ -10,6 +11,10 @@ namespace Polecat.Storage;
/// <summary>
/// Discovers and caches metadata about a document type: ID property, table name, ID accessors.
/// </summary>
[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "Class-level: AddSubClassHierarchy uses Assembly.GetTypes() to discover subclasses; document hierarchies are part of the registered surface and AOT consumers must preserve subclass types via their JsonSerializerContext / per-type registration.")]
[UnconditionalSuppressMessage("Trimming", "IL2070:DynamicallyAccessedMembers",
Justification = "Class-level: reflects PublicProperties on the document Type (FindIdProperty, DiscoverIndexAttributes). The document type is preserved at the registration boundary (Schema.For<T>()), where T flows in from caller code that trimming sees.")]
internal class DocumentMapping
{
private static readonly HashSet<Type> SupportedIdTypes =
Expand Down
3 changes: 3 additions & 0 deletions src/Polecat/Storage/DocumentMappingExpression.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;

namespace Polecat.Storage;
Expand All @@ -6,6 +7,8 @@ namespace Polecat.Storage;
/// Fluent configuration builder for a document type's mapping.
/// Used via StoreOptions.Schema.For&lt;T&gt;().
/// </summary>
[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "Class-level: AddSubClassHierarchy uses Assembly.GetTypes() to discover subclasses of T. Document hierarchies are part of the registered surface and AOT consumers must preserve subclass types (JsonSerializerContext / per-type registration) per the AOT publishing guide.")]
public class DocumentMappingExpression<T>
{
internal readonly Type DocumentType = typeof(T);
Expand Down
Loading