1234567891011121314151617181920212223 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Design;
- using Microsoft.EntityFrameworkCore.Infrastructure;
- namespace Application.ATG_Classic_App
- {
- /// <summary>
- /// Visual studio Add-Migration will detect and use this to get DbContext
- /// </summary>
- public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
- {
- public AppDbContext CreateDbContext(string[] args)
- {
- var option = new DbContextOptionsBuilder<AppDbContext>()
- .UseSqlite("Data Source=Application.ATG_Classic_App_database.db").Options;
- return new AppDbContext(option);
- return new AppDbContext();
- }
- }
- }
|