Implemetato databese locale con EntityFramework
This commit is contained in:
16
SteUp.Data/LocalDb/AppDbContextFactory.cs
Normal file
16
SteUp.Data/LocalDb/AppDbContextFactory.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace SteUp.Data.LocalDb;
|
||||
|
||||
public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
|
||||
{
|
||||
public AppDbContext CreateDbContext(string[] args)
|
||||
{
|
||||
var options = new DbContextOptionsBuilder<AppDbContext>()
|
||||
.UseSqlite("Data Source=design-time.db3")
|
||||
.Options;
|
||||
|
||||
return new AppDbContext(options);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user