Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 public LinkApiRepository(LinkDbContext context)
 {
     _context = context;
 }
Esempio n. 3
0
 public LinkRepository(IHashDecoder hashDecoder, IHashEncoder hashEncoder, LinkDbContext context)
 {
     _context     = context;
     _hashDecoder = hashDecoder;
     _hashEncoder = hashEncoder;
 }
Esempio n. 4
0
 public EfLinkQueryRepository(LinkDbContext dbContext)
 {
     this._dbContext = dbContext;
 }
 public EfLinkCommandRepository(LinkDbContext dbContext, ILogger <EfLinkCommandRepository> logger)
 {
     this._dbContext = dbContext;
     this._logger    = logger;
 }
Esempio n. 6
0
 public LinksController(LinkDbContext context)
 {
     _linkDbContext = context;
 }
Esempio n. 7
0
 public LinkRepository(LinkDbContext linkDbContext)
 {
     DbContext = linkDbContext;
 }