public static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(Configuration).CreateLogger();

            try
            {
                var host = CreateHostBuilder(args).Build();

                var scope           = host.Services.CreateScope();
                var serviceProvider = scope.ServiceProvider;

                LinkDbContext linkDbContext = serviceProvider.GetRequiredService <LinkDbContext>();
                linkDbContext.Database.Migrate();

                LinkLogDbContext linkLogDbContext = serviceProvider.GetRequiredService <LinkLogDbContext>();
                linkLogDbContext.Database.Migrate();

                host.Run();
            }
            catch (Exception exception)
            {
                Log.Fatal(exception, "Host terminated unexpectedly");
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
示例#2
0
 public LinkApiRepository(LinkDbContext context)
 {
     _context = context;
 }
示例#3
0
 public LinkRepository(IHashDecoder hashDecoder, IHashEncoder hashEncoder, LinkDbContext context)
 {
     _context     = context;
     _hashDecoder = hashDecoder;
     _hashEncoder = hashEncoder;
 }
示例#4
0
 public EfLinkQueryRepository(LinkDbContext dbContext)
 {
     this._dbContext = dbContext;
 }
 public EfLinkCommandRepository(LinkDbContext dbContext, ILogger <EfLinkCommandRepository> logger)
 {
     this._dbContext = dbContext;
     this._logger    = logger;
 }
示例#6
0
 public LinksController(LinkDbContext context)
 {
     _linkDbContext = context;
 }
示例#7
0
 public LinkRepository(LinkDbContext linkDbContext)
 {
     DbContext = linkDbContext;
 }