Refactor: Use session-based TempData provider
Switch from cookie-based to session-based TempData to avoid cookie size limits when storing AI categorization proposals. Chain AddSessionStateTempDataProvider() to AddRazorPages(). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,6 @@ CultureInfo.DefaultThreadCurrentUICulture = culture;
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
builder.Services.AddRazorPages();
|
|
||||||
builder.Services.AddDbContext<MoneyMapContext>(options =>
|
builder.Services.AddDbContext<MoneyMapContext>(options =>
|
||||||
options.UseSqlServer(builder.Configuration.GetConnectionString("MoneyMapDb")));
|
options.UseSqlServer(builder.Configuration.GetConnectionString("MoneyMapDb")));
|
||||||
|
|
||||||
@@ -27,6 +26,10 @@ builder.Services.AddSession(options =>
|
|||||||
options.IOTimeout = TimeSpan.FromMinutes(5); // Increase timeout for large data
|
options.IOTimeout = TimeSpan.FromMinutes(5); // Increase timeout for large data
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Use session-based TempData provider to avoid cookie size limits
|
||||||
|
builder.Services.AddRazorPages()
|
||||||
|
.AddSessionStateTempDataProvider();
|
||||||
|
|
||||||
// Core transaction and import services
|
// Core transaction and import services
|
||||||
builder.Services.AddScoped<ITransactionImporter, TransactionImporter>();
|
builder.Services.AddScoped<ITransactionImporter, TransactionImporter>();
|
||||||
builder.Services.AddScoped<ICardResolver, CardResolver>();
|
builder.Services.AddScoped<ICardResolver, CardResolver>();
|
||||||
|
|||||||
Reference in New Issue
Block a user