Cayaqui.MPS.Metadata 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cayaqui.MPS.Metadata --version 0.1.0
                    
NuGet\Install-Package Cayaqui.MPS.Metadata -Version 0.1.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="Cayaqui.MPS.Metadata" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cayaqui.MPS.Metadata" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Cayaqui.MPS.Metadata" />
                    
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 Cayaqui.MPS.Metadata --version 0.1.0
                    
#r "nuget: Cayaqui.MPS.Metadata, 0.1.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 Cayaqui.MPS.Metadata@0.1.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=Cayaqui.MPS.Metadata&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Cayaqui.MPS.Metadata&version=0.1.0
                    
Install as a Cake Tool

Cayaqui.MPS.Metadata

Zero-dependency attributes + resolver para decorar DTOs con metadata consumida por web grids, Cayaqui.MPS.Reports y Cayaqui.MPS.ExcelImport. Un solo decorado → tres usos consistentes.

Distribución propietaria — requiere contrato comercial con Cayaqui. Ver LICENSE.txt.

Instalación

dotnet add package Cayaqui.MPS.Metadata
builder.Services.AddMpsMetadata();  // registra IExtendedPropertyResolver singleton

Ejemplo

public sealed class ControlAccountDto
{
    [Label("Código CA")] [Wbs] [UpperCase]
    [NotEmpty] [MaxLength(20)] [RegularExpression(@"^[A-Z]{2,3}-\d{3,}$")]
    [ImportAlias("Code", "Control Account")]
    public string Code { get; set; } = "";

    [Currency("USD", 2)] [Money] [Align(TextAlign.Right)] [ColumnWidth(140)]
    public decimal Bac { get; set; }

    [Percentage(1)] [EvmIndicator(EvmKind.Cpi)] [EvmBand(green: 0.97, yellow: 0.90)]
    public decimal Cpi { get; set; }

    [Date("dd-MMM-yy")] [Schedule]
    public DateTime ControlDate { get; set; }

    [Badge]   // reads colors from BadgeEnum values
    public ProjectStatus Status { get; set; }

    [Mask(MaskKind.Email, visibleChars: 1)] [Tooltip("Owner email (masked)")]
    public string Owner { get; set; } = "";

    [Hidden]
    public Guid InternalId { get; set; }

    [ImportAlias("SPI", "Schedule Performance Index")]
    [ImportCulture("es-CL")]
    public decimal Spi { get; set; }
}

public enum ProjectStatus
{
    [BadgeColor(BadgeKind.Neutral)]  Draft,
    [BadgeColor(BadgeKind.Info)]     InReview,
    [BadgeColor(BadgeKind.Success)]  Approved,
    [BadgeColor(BadgeKind.Warning)]  OnHold,
    [BadgeColor(BadgeKind.Error)]    Cancelled
}

Los 37 atributos

Display

  • [Label("text")] — override (reuse [Display(Name)] si existe)
  • [Tooltip("text")] — tooltip específico
  • [Placeholder("text")] — placeholder input Blazor
  • Reusar [Display(Name, Description, Order, GroupName)] de DataAnnotations

Format

  • [Currency("USD", 2)]"USD 1,234.56"
  • [Percentage(1)]0.756"75.6%"
  • [Date("dd-MMM-yy")] — formato custom
  • [Integer(thousands: true)]"1,234,567"
  • [DecimalFormat(decimals: 4)]
  • [Duration(DurationUnit.Days)]"5d", "3h", "15m"

Transform (no mutan el valor, sólo el display)

  • [UpperCase] · [LowerCase] · [TitleCase]
  • [Mask(MaskKind.Email, visibleChars: 1)]"a********@cayaqui.com"
  • [Mask(MaskKind.Email, visibleChars: 3)]"ale******@cayaqui.com"
  • [Mask(MaskKind.LastChars, visibleChars: 4)]"******7890"
  • [Truncate(30)]

Layout / Visibility

  • [Align(TextAlign.Right)]
  • [ColumnWidth(150)]
  • [VisibleIn(RenderTargets.Web | RenderTargets.Report)]
  • [Hidden] — shortcut de [VisibleIn(None)]
  • [ReadOnlyDisplay]

Badge

  • [Badge(BadgeKind.Success)] — fijo
  • [Badge] + [BadgeColor(...)] en cada valor del enum — mapeado por valor

Validation (custom shortcuts — reuse DataAnnotations para el resto)

  • [NotEmpty][Required(AllowEmptyStrings = false)]
  • [Min(0)] / [Max(100)] — sugar sobre [Range]
  • Reusar [Required], [MaxLength], [MinLength], [Range], [RegularExpression], [EmailAddress], [Phone], [Url]

EPC dominio

  • [EvmIndicator(EvmKind.Cpi)] — renderer aplica íconos/colores contextuales
  • [EvmBand(green: 0.95, yellow: 0.85)] — thresholds semaforo configurables
  • [Wbs] · [Cbs] · [Schedule] · [Money] — markers semánticos

Import

  • [ImportAlias("CPI", "Cost Performance Index")] — multi-header match
  • [ImportIgnore]
  • [ImportDefault(0)]
  • [ImportCulture("es-CL")] — parsing locale
  • [ImportColumn(3)] — opt-in por posición
  • [ImportTrim(false)] — default true
  • [ImportRegex(@"^[A-Z]+-\d+$")]

API del resolver

public interface IExtendedPropertyResolver
{
    PropertyMetadata? Get(Type dtoType, string propertyName);
    IReadOnlyList<PropertyMetadata> GetAll(Type dtoType);
    string? Format(object? value, Type dtoType, string propertyName, CultureInfo? culture = null);
    bool TryParse(string? text, Type dtoType, string propertyName, CultureInfo? culture, out object? value);
}

Cache por Type en primer acceso, thread-safe.

Requisitos

  • .NET 10.0 o superior
  • Zero dependencies externas (sólo Microsoft.Extensions.DependencyInjection.Abstractions para el extension method, que es BCL+)
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Cayaqui.MPS.Metadata:

Package Downloads
Cayaqui.MPS.Components

Design system and EVM/EPC reusable components (KPI strip, gauges CPI/SPI/PF, S-curves, Gantt, WBS tree grid, R9C, risk heatmap, change orders, purchase orders, engineering deliverables, lookahead grid) for .NET 10 Blazor WebApp (Interactive Server) on top of Syncfusion.Blazor. Proprietary — requires a commercial agreement with Cayaqui.

Cayaqui.MPS.ExcelExport

Exports strongly-typed collections of DTOs to .xlsx using the attributes from Cayaqui.MPS.Metadata: Label for headers, Currency/Percentage/Date for cell formats, Align/ColumnWidth for layout, VisibleIn/Hidden for visibility, Order for column order, Badge for cell background color. Uses Syncfusion XlsIO. Proprietary — requires a commercial agreement with Cayaqui.

Cayaqui.MPS.Reports

Template-based report generation for .NET 10 using Syncfusion File Formats (OpenXML compliant). Supports Excel (XlsIO), Word (DocIO), PowerPoint (Presentation) templates with MailMerge / template markers / placeholder replacement, native chart generation, and PDF conversion. Templates are loaded from Cayaqui.MPS.Storage. Proprietary — requires a commercial agreement with Cayaqui.

Cayaqui.MPS.Storage

Generic storage service for .NET 10 with pluggable providers (Azure Blob Storage, Local File System). Includes streaming upload/download, SAS/file URL generation, container/key model and DI options pattern. Proprietary — requires a commercial agreement with Cayaqui.

Cayaqui.MPS.ExcelImport

Reads .xlsx files and materializes strongly-typed DTOs using the attributes from Cayaqui.MPS.Metadata (ImportAlias, ImportColumn, ImportCulture, ImportDefault, ImportTrim, ImportRegex) plus resolver-based TryParse. Uses Syncfusion XlsIO for spreadsheet access. Proprietary — requires a commercial agreement with Cayaqui.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.17.1 37 5/25/2026
0.17.0 40 5/25/2026
0.4.0 699 5/6/2026
0.3.0 114 5/5/2026
0.2.0 610 4/24/2026
0.1.1 124 4/24/2026
0.1.0 136 4/24/2026

Initial release. 37 attributes across Display/Format/Transform/Layout/Badge/Validation/EPC/Import categories + resolver with type cache + Format/TryParse methods.