question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document breaking changes coming in 11.0

See original GitHub issue

This issue tracks breaking changes coming in 11.0 that will need to be documented:

Supported platform changes

  • Removal of netcore2.1 (MS official support ends 21 August 2021)

cascade mode changes

Public API

  • Asynchronous validators will now throw an exception when invoked synchronously, rather than silently running synchronously.
  • OnFailure/OnAnyFailure removed
  • Remove backwards compatibility property validator layer

Test Helper

  • Remove deprecated test helper methods

Internal API

  • IValidationRule<T,TProperty>.CurrentValidator has been removed (use the Current property instead)
  • IValidationRule<T,TProperty>.Current now returns an IRuleComponent<T,TProperty> interface instead of RuleComponent<T,TProperty> (necessary to support variance)
  • IValidationRule<T,TProperty>.MessageBuilder’s argument is now an IMessageBuilderContext<T,TProperty> interface instead of MessageBuilderContext<T,TProperty> class (necessary to support variance)
  • IValidationRule<T,TProperty>.MessageBuilder is now set-only, and has no getter exposed (needed to support variance), meaning you can only have one message builder per rule chain.
  • IRuleComponent<T,TProperty>.CustomStateProvider is now set-only to support variance
  • IRuleComponent<T,TProperty>.SeverityProvider is now set-only to support variance
  • GetErrorMessage is no longer exposed on IRuleComponent<T,TProperty>
  • Remove deprecated Options property from RuleComponent
  • MemberAccessor removed

Aspnet integration

  • Remove deprecated RunDefaultMvcValidationAfterFluentValidationExecutes

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JeremySkinnercommented, Aug 26, 2021

I think you’ll also need to bring across the MemberAccessor class (or at least, the parts of it that dynamically build property setters)

1reaction
ronaldkrooncommented, Aug 25, 2021

Hi, Why are you deprecating this way of writing validation? This

  validator.ShouldNotHaveValidationErrorFor(x => x.Forename, "test");

looks so much better than

  var person = new Person {Forename = "test"};
  validator.TestValidate(person).ShouldNotHaveValidationErrorFor(x => x.Forename);

Plus it allowed us to write extensions methods to test multiple values at once like e.g.:

  public static void ShouldAllowAZ09ValuesOnly<TMessage>(this IValidator<TMessage> validator, 
    Expression<Func<TMessage, string>> expression)
    where TMessage : class, new()
  {
    foreach (var value in new[] { "A", "ABC", "A0", "0", "123" })
    {
      validator.ShouldNotHaveValidationErrorFor(expression, value);
    }
    foreach (var value in new[] { "a", "A B", "A-B" })
    {
      validator.ShouldHaveValidationErrorFor(expression, value);
    }
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upcoming breaking changes in Azure PowerShell
Learn about upcoming breaking changes to the Azure Az PowerShell module. ... DockerBridgeCidr parameter will be deprecated in Az 11.0.0 ...
Read more >
Breaking changes in CMS 11
Describes breaking changes for Optimizely Content Management System (CMS 11) in relation to previous version 10, and the steps needed to update affected...
Read more >
What's new in C# 11 - C# Guide
Get an overview of the new features added in C# 11.
Read more >
Behavior changes: Apps targeting Android 11
Like earlier releases, Android 11 includes behavior changes that may affect your app. The following behavior changes apply exclusively to apps that are ......
Read more >
Breaking changes | ArcGIS Maps SDK for JavaScript 4.27
A comprehensive guide to all breaking changes for the ArcGIS Maps SDK for JavaScript , ordered by release version. This guide is helpful...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found