コード例 #1
0
 public Emissary(IConfiguration config, IBungieApiService bungieApiService, IManifestDao manifestDao, EmissaryDbContext dbContext, IEmissaryDao emissaryDao, IAuthorizationService authorizationService)
 {
     this.config               = config;
     this.bungieApiService     = bungieApiService;
     this.manifestDao          = manifestDao;
     this.dbContext            = dbContext;
     this.emissaryDao          = emissaryDao;
     this.authorizationService = authorizationService;
 }
コード例 #2
0
        public static Emissary Startup(IConfiguration config)
        {
            IBungieApiService bungieApiService = new BungieApiService(config, new HttpClient());
            IManifestDao      manifestDao      = new ManifestDao(config, new DatabaseAccessor());
            SqliteConnection  sqliteConnection = new SqliteConnection($"DataSource={config["Emissary:DatabasePath"]}");

            sqliteConnection.Open();
            DbContextOptions <EmissaryDbContext> dbContextOptions = new DbContextOptionsBuilder <EmissaryDbContext>()
                                                                    .UseSqlite(sqliteConnection)
                                                                    .Options;
            EmissaryDbContext dbContext = new EmissaryDbContext(dbContextOptions);

            dbContext.Database.EnsureCreated();
            IEmissaryDao          emissaryDao          = new EmissaryDao(dbContext);
            IAuthorizationService authorizationService = new AuthorizationService(config, bungieApiService, emissaryDao);

            return(new Emissary(config, bungieApiService, manifestDao, dbContext, emissaryDao, authorizationService));
        }
コード例 #3
0
 public AccessTokenDao(EmissaryDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #4
0
 public LoadoutDao(EmissaryDbContext context)
 {
     this.dbContext = context;
 }
コード例 #5
0
 public UserDao(EmissaryDbContext context)
 {
     this.dbContext = context;
 }