Blazor - razor page not updating after property from DI Service is changed
问题 Using dotnet 3.1.100-preview2-014569 Ok consider the following example: Create a new Blazor WebAssemply project from template, then add the following: books.razor @page "/books" @inject BookService bookService @if (bookService.isLoaned) { <p><em>Book loaned</em></p> } else { <p><em>Book returned</em></p> } BookService.cs public class BookService { public int BookId { get; set; } public string Title { get; set; } public bool isLoaned { get; set; } } Startup.cs public void ConfigureServices