Added ef core integration
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
using HopFrame.Core;
|
||||
using HopFrame.Core.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TestApplication;
|
||||
using TestApplication.Components;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -6,6 +10,15 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
builder.Services.AddEntityFrameworkInMemoryDatabase();
|
||||
builder.Services.AddDbContext<DatabaseContext>(options => {
|
||||
options.UseInMemoryDatabase("testing");
|
||||
});
|
||||
|
||||
builder.Services.AddHopFrame(config => {
|
||||
config.AddDbContext<DatabaseContext>();
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
Reference in New Issue
Block a user