UserPointManagement/src/UserPointManagement.Persist.../UserPointManagementDbContex...

18 lines
696 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using UserPointManagement.Persistence;
namespace UserPointManagement.Web;
public class UserPointManagementDbContextFactory : IDesignTimeDbContextFactory<UserPointManagementDbContext>
{
public UserPointManagementDbContext CreateDbContext(string[] args)
{
var optionsBuilder = new DbContextOptionsBuilder<UserPointManagementDbContext>();
optionsBuilder
.UseNpgsql("Server=67.230.184.225;Port=58007;UserId=postgres;Password=postgres;Database=tiamo;")
.UseSnakeCaseNamingConvention();
return new UserPointManagementDbContext(optionsBuilder.Options);
}
}