Fix broken Blazor file upload component (#22582)
parent
a7f992a209
commit
21e12d47bb
|
@ -65,7 +65,7 @@
|
|||
if (uploadResults.SingleOrDefault(
|
||||
f => f.FileName == file.Name) is null)
|
||||
{
|
||||
using var fileContent = new StreamContent(file.OpenReadStream());
|
||||
var fileContent = new StreamContent(file.OpenReadStream());
|
||||
|
||||
files.Add(
|
||||
new()
|
||||
|
|
|
@ -30,7 +30,7 @@ Web API controllers don't have to check `ModelState.IsValid` if they have the `[
|
|||
|
||||
## Rerun validation
|
||||
|
||||
Validation is automatic, but you might want to repeat it manually. For example, you might compute a value for a property and want to rerun validation after setting the property to the computed value. To rerun validation, call [`ModelState.ClearValidationState`](Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.ClearValidationState) to clear validation specific to the model being validated followed by `TryValidateModel`:
|
||||
Validation is automatic, but you might want to repeat it manually. For example, you might compute a value for a property and want to rerun validation after setting the property to the computed value. To rerun validation, call <xref:Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.ClearValidationState%2A?displayProperty=nameWithType> to clear validation specific to the model being validated followed by `TryValidateModel`:
|
||||
|
||||
[!code-csharp[](validation/samples/3.x/ValidationSample/Pages/Movies/Create.cshtml.cs?name=snippet_TryValidate&highlight=6-10)]
|
||||
|
||||
|
|
Loading…
Reference in New Issue