diff --git a/aspnetcore/blazor/common/samples/5.x/BlazorSample_WebAssembly/Pages/file-uploads/FileUpload2.razor b/aspnetcore/blazor/common/samples/5.x/BlazorSample_WebAssembly/Pages/file-uploads/FileUpload2.razor index 9062701741..dea55c411a 100644 --- a/aspnetcore/blazor/common/samples/5.x/BlazorSample_WebAssembly/Pages/file-uploads/FileUpload2.razor +++ b/aspnetcore/blazor/common/samples/5.x/BlazorSample_WebAssembly/Pages/file-uploads/FileUpload2.razor @@ -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() diff --git a/aspnetcore/mvc/models/validation.md b/aspnetcore/mvc/models/validation.md index da70c84cc9..88c120767c 100644 --- a/aspnetcore/mvc/models/validation.md +++ b/aspnetcore/mvc/models/validation.md @@ -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 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)]