17 lines
671 B
C#
17 lines
671 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace ConstructorApp.DataAccessLayer.Concrete
|
|
{
|
|
public class ConstructorContextFactory : IDesignTimeDbContextFactory<ConstructorContext>
|
|
{
|
|
public ConstructorContext CreateDbContext(string[] args)
|
|
{
|
|
var optionsBuilder = new DbContextOptionsBuilder<ConstructorContext>();
|
|
optionsBuilder.UseSqlServer("Server=SABI\\SQLEXPRESS;Initial Catalog=CONSTRUCTOR;User ID=sa;Password=13579spP!!!!;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True");
|
|
|
|
return new ConstructorContext(optionsBuilder.Options);
|
|
}
|
|
}
|
|
}
|