Köp och sälj notor kan läsas in i csv-format och kan sedan listas
This commit is contained in:
@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user