Skip to content

docs: fix snippet-source inaccuracies and regenerate - #4736

Merged
jeremydmiller merged 1 commit into
masterfrom
docs/v9-accuracy-snippet-sources
Jun 14, 2026
Merged

jeremydmiller merged 1 commit into
masterfrom
docs/v9-accuracy-snippet-sources

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

What

Second follow-up from the docs audit. These defects live inside generated snippet blocks, so the fix is in the source #region markers; the markdown is then regenerated with mdsnippets. Source changes are comment-only except where noted.

Fixes

  • diagnostics / sample_using_request_count — sync Count()/Any() → CountAsync()/AnyAsync(). Synchronous query execution was removed in Marten 9 (these would throw NotSupportedException). Request count is unchanged (3).
  • linq/operators / sample_select_a_single_value — removed Last()/LastOrDefault() from the element-operations sample. Marten throws InvalidOperationException on them; the guidance is to reverse the ordering and use First()/FirstOrDefault(). Comment updated accordingly.
  • events/appending / sample_configuring_event_append_mode — comment claimed Rich is the default "from 4.0 on"; the default is QuickWithServerTimestamps as of Marten 9.
  • events/subscriptions / sample_errorhandlingsubscription — AfterCommitAsync and BeforeCommitAsync log messages were swapped.
  • multi-stream + optimizing / sample_showing_fanout_rules — cache comment said "up to 100" but the value is 1000.
  • computed-indexes + unique / sample_customizing-calculated-index — copy-paste "Change the index method to brin" comment sat over a SortOrder.Desc assignment.
  • schema/authorization / sample_customizing_table_creation — comment implied DropThenCreate is the default; CreateIfNotExists is the default.

Verification

mdsnippets regenerated the affected markdown (incidental snippet source-link line-number refreshes ride along). Marten.Testing builds clean (the only non-comment source edits — CountAsync/AnyAsync and the removed Last() lines — are there).

🤖 Generated with Claude Code

Corrects defects that live inside generated snippet blocks (source
#region markers), then regenerates the markdown:

- diagnostics: sync Count()/Any() -> CountAsync()/AnyAsync() (sync query
  execution was removed in Marten 9)
- linq/operators: drop Last()/LastOrDefault() from the element-operations
  sample (Marten throws on them; reverse the order and use First())
- events/appending: append-mode comment said Rich is the default 'from
  4.0 on'; the default is QuickWithServerTimestamps as of Marten 9
- subscriptions: AfterCommit/BeforeCommit log messages were swapped
- multi-stream/optimizing: cache comment said 100 but the value is 1000
- computed-indexes/unique: copy-paste 'brin' comment over a sort-order set
- schema/authorization: table-creation comment implied DropThenCreate is
  the default; CreateIfNotExists is the default
@jeremydmiller
jeremydmiller merged commit 810c511 into master Jun 14, 2026
8 checks passed
@jeremydmiller
jeremydmiller deleted the docs/v9-accuracy-snippet-sources branch June 14, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant