Köp och sälj notor kan läsas in i csv-format och kan sedan listas

This commit is contained in:
2026-09-17 08:51:56 +02:00
parent 02b5fb655a
commit 07dcefa6a4
35 changed files with 1701 additions and 19 deletions

View File

@ -1,5 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using StockWebHistory.Data;
using StockWebHistory.Services;
namespace StockWebHistory
{
@ -12,12 +14,24 @@ namespace StockWebHistory
// Add services to the container.x
builder.Services.AddControllersWithViews();
builder.Services.AddDbContext<StockWebDbContext>(options =>
options.UseInMemoryDatabase("StockWebHistoryDB")
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"))
.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning))
);
builder.Services.AddScoped<ITransactionNotesServices, TransactionNotesServices>();
builder.Services.AddScoped<IStockEquityServices, StockEquityServices>();
builder.Services.AddScoped<IFileProcessingService, FileProcessingService>();
var app = builder.Build();
using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<StockWebDbContext>();
db.Database.Migrate();
}
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{