diff --git a/samples/todoapp-tutorial/ServerApp/Controllers/TodoItemController.cs b/samples/todoapp-tutorial/ServerApp/Controllers/TodoItemController.cs index 94822980..54f0b3ca 100644 --- a/samples/todoapp-tutorial/ServerApp/Controllers/TodoItemController.cs +++ b/samples/todoapp-tutorial/ServerApp/Controllers/TodoItemController.cs @@ -1,10 +1,23 @@ using CommunityToolkit.Datasync.Server; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; using ServerApp.Models; namespace ServerApp.Controllers; [Route("tables/todoitem")] -public class TodoItemController(IRepository repository) : TableController(repository) +public class TodoItemController : TableController { -} \ No newline at end of file + public TodoItemController(IRepository repository, ILogger logger) + : base(repository) + { + Logger = logger; + Options = new TableControllerOptions + { + // Demonstrates entity serialization in the logs (entity ID at Information, full entity at Debug). + // Only enable when the additional diagnostic detail is required and the log sink is secured, + // as entity contents may contain PII, secrets, or other sensitive business data. + UnsafeEntityLogging = true + }; + } +} diff --git a/samples/todoapp-tutorial/ServerApp/ServerApp.csproj b/samples/todoapp-tutorial/ServerApp/ServerApp.csproj index 703715ec..45288329 100644 --- a/samples/todoapp-tutorial/ServerApp/ServerApp.csproj +++ b/samples/todoapp-tutorial/ServerApp/ServerApp.csproj @@ -7,8 +7,8 @@ - - + +