Class SaveOptions
- Namespace
- eQuantic.Core.Data.Repository.Options
- Assembly
- eQuantic.Core.Data.dll
Options that control how changes are persisted when a unit of work is committed.
[ExcludeFromCodeCoverage]
public class SaveOptions
- Inheritance
-
SaveOptions
- Inherited Members
Methods
GetUserId<TUserKey>()
Gets the acting user identifier previously recorded through WithAuditMetadata<TUserKey>(TUserKey).
public TUserKey GetUserId<TUserKey>()
Returns
- TUserKey
The acting user identifier, or the default value when none was recorded.
Type Parameters
TUserKeyThe type of the user identifier.
IsAuditMetadata()
Gets a value indicating whether audit metadata should be saved.
public bool IsAuditMetadata()
Returns
- bool
truewhen audit metadata is enabled; otherwisefalse.
WithAuditMetadata<TUserKey>(TUserKey)
Enables audit metadata and records the acting user identifier.
public SaveOptions WithAuditMetadata<TUserKey>(TUserKey userId)
Parameters
userIdTUserKeyThe acting user identifier.
Returns
- SaveOptions
The same SaveOptions instance for chaining.
Type Parameters
TUserKeyThe type of the user identifier.