DocumentAddressProvider.BeginScope Method

Namespace
Kampute.DocToolkit.Routing
Assembly
  • Kampute.DocToolkit.dll

Definition

Creates a scoped URL context for the specified document path and model.
public virtual DocumentUrlContext BeginScope(string directory, IDocumentModel model)

Parameters

directory string
The directory path of the document being rendered relative to the documentation root.
model IDocumentModel
The document model being processed, or null if not applicable.

Returns

DocumentUrlContext
A DocumentUrlContext object that represents the scoped URL context. When disposed, the context will be reset.

Remarks

This method should be called before processing a document to establish the correct context for resolving any relative URLs within that document. The returned context object should be disposed when document processing is complete to restore the previous context.