DCoding.Data.DVault.Analyzers 0.13.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DCoding.Data.DVault.Analyzers --version 0.13.0
                    
NuGet\Install-Package DCoding.Data.DVault.Analyzers -Version 0.13.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DCoding.Data.DVault.Analyzers" Version="0.13.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DCoding.Data.DVault.Analyzers" Version="0.13.0" />
                    
Directory.Packages.props
<PackageReference Include="DCoding.Data.DVault.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DCoding.Data.DVault.Analyzers --version 0.13.0
                    
#r "nuget: DCoding.Data.DVault.Analyzers, 0.13.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DCoding.Data.DVault.Analyzers@0.13.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DCoding.Data.DVault.Analyzers&version=0.13.0
                    
Install as a Cake Addin
#tool nuget:?package=DCoding.Data.DVault.Analyzers&version=0.13.0
                    
Install as a Cake Tool

DCoding.Data.DVault.Analyzers

Roslyn analyzers and source generators for DVault compile-time metadata declarations. The v1 package reports:

  • DMV1901 for unsupported BusinessKey(...), Payload(...), or DrivingKey(...) selector shapes.
  • DMV1902 for duplicate logical member declarations inside the same applicable Code-First builder lambda scope.
  • DMV1950 through DMV1955 for malformed generated mapping declarations, missing generated row bindings, invalid source members, duplicate binding order or names, and repeated link participant hub names.

The package also provides bounded code fixes for DMV1901 anonymous-object direct-member expansion and DMV1902 later-duplicate removal. Its source generator emits registry-backed typed row mappers from the public DCoding.Data.DVault compile-time mapping attributes; generated helpers still require callers to supply load timestamps and record sources through the existing explicit save flow.

Installation

Install the analyzer package in projects that declare DVault Code-First metadata or compile-time generated row mappings through normal Roslyn analyzer package conventions:

<ItemGroup>
  <PackageReference Include="DCoding.Data.DVault.Analyzers" Version="0.13.0" PrivateAssets="all" />
</ItemGroup>

PrivateAssets="all" keeps the analyzer local to the project that owns the declarations. The package supplies analyzer assets and does not require a runtime reference from application code.

Code-First Analyzer Scope

The analyzer slice inspects the first direct lambda selector passed to BusinessKey(...), Payload(...), and DrivingKey(...). It expects one direct readable scalar member on the configured entity type, such as hub.BusinessKey(customer => customer.CustomerId) or satellite.Payload(customer => customer.EmailAddress).

Composite business keys, payloads, and driving keys should use repeated single-member calls in their canonical order. When an anonymous-object selector contains only direct readable scalar member accesses, the DMV1901 code fix can expand it into repeated same-verb single-member calls in source order. The DMV1901 code fix is intentionally not offered for selector variables, indirect selectors, computed selectors, nested selectors, method calls, collection-valued selectors, or mixed anonymous-object selectors that are not mechanically expandable.

The DMV1902 code fix removes the later duplicate BusinessKey(...), Payload(...), or DrivingKey(...) declaration and leaves the first declaration authoritative within the same fluent scope.

Generated Mapper Scope

The source generator recognizes mapping declarations from DCoding.Data.DVault runtime attributes on one source type:

  • DataVaultHubMappingAttribute plus ordered DataVaultBusinessKeyBindingAttribute values.
  • DataVaultLinkMappingAttribute plus ordered DataVaultLinkParticipantBindingAttribute values whose participant hub names are unique by StringComparer.Ordinal.
  • DataVaultHubSatelliteMappingAttribute plus parent hash-key, hash-diff, ordered payload, and optional ordered driving-key bindings.

Generated code implements the existing IDataVaultHubMapper<TSource>, IDataVaultLinkMapper<TSource>, or IDataVaultSatelliteMapper<TSource> contracts and constructs DataVaultRegistry*SaveOperation values. It does not execute EF models, register mappings at runtime, derive hash keys or hash diffs, or hide the caller-supplied loadTimestamp and recordSource boundary.

Suppression

Suppress DMV diagnostics only where the consuming project intentionally accepts a pattern outside this analyzer slice. Use standard C# and Roslyn analyzer suppression mechanisms.

For a narrow local exception, use a pragma around the intentional declaration:

#pragma warning disable DMV1901
satellite.Payload(emailSelector);
#pragma warning restore DMV1901

For a project or path-level policy, configure analyzer severities in .editorconfig:

dotnet_diagnostic.DMV1901.severity = none
dotnet_diagnostic.DMV1902.severity = none

For MSBuild-level suppression, append the diagnostic ids to NoWarn:

<PropertyGroup>
  <NoWarn>$(NoWarn);DMV1901;DMV1902</NoWarn>
</PropertyGroup>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.15.0 34 5/19/2026
0.14.0 85 5/18/2026
0.13.0 90 5/18/2026
0.12.0 85 5/17/2026
0.11.0 84 5/15/2026
0.10.0 82 5/15/2026