Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

丁松杰 / Pole

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • Pole
  • samples
  • apis
  • Product.Api
  • ProductDbContextDesignFactory.cs
Find file
BlameHistoryPermalink
  • 丁松杰's avatar
    添加部分测试代码 · be19a9e3
    丁松杰 committed 5 years ago
    be19a9e3
ProductDbContextDesignFactory.cs 989 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
//using Pole.Domain.EntityframeworkCore.MediatR;
//using Product.Api.Infrastructure;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace Product.Api
{
    //public class ProductDbContextDesignFactory : IDesignTimeDbContextFactory<ProductDbContext>
    //{
    //    public ProductDbContext CreateDbContext(string[] args)
    //    {
    //        IConfigurationRoot configuration = new ConfigurationBuilder()
    //         .SetBasePath(Directory.GetCurrentDirectory())
    //         .AddJsonFile("appsettings.Development.json")
    //         .Build();
    //        var optionsBuilder = new DbContextOptionsBuilder<ProductDbContext>()
    //            .UseNpgsql(configuration["postgres:main"]);

    //        return new ProductDbContext(optionsBuilder.Options);
    //    }
    //}
}