Typely
GitHub
  • Overview
    • πŸ‘Welcome!
  • Validations
    • πŸ“Common
    • πŸ”’Number
    • βš–οΈComparable
    • ✏️String
  • Customize errors
    • 🌎Localization
    • πŸ”Sensitive data
  • General
    • 🧩Class VS Struct
    • πŸ–ΌοΈSupported frameworks
    • πŸš€Benchmarks
    • ⚠️Limitations
  • Design decisions
    • πŸ”„Conversions
    • ℹ️Use of interfaces
    • πŸ€Έβ€β™‚οΈUnderlying type comparison
    • πŸ’‚Validations
Powered by GitBook
On this page
Edit on GitHub
  1. Customize errors

Localization

You can localize validation messages using a lambda expression and a .resx file containing all translations. The body of the lambda will be built into the type itself and executed at run time.

builder.OfString().For("Planet")
    .Name(() => Names.Planet)
    .NotEqual("sun").WithMessage(() => ErrorMessages.NotEqual);
PreviousStringNextSensitive data

Last updated 2 years ago

🌎