コード例 #1
0
 public BowlingController(BowlingContext context, PortfolioContext userContext, UserManager <ApplicationUser> userManager, ILogger <BowlingController> logger)
 {
     _bowlingContext = context;
     _userContext    = userContext;
     _userManager    = userManager;
     _logger         = logger;
 }
コード例 #2
0
        public BowlingSystemTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder <BowlingContext>();

            optionsBuilder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=BengansBowling;Trusted_Connection=True;MultipleActiveResultSets=true");
            //optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());

            var context = new BowlingContext(optionsBuilder.Options);

            _serviceProvider = new ServiceCollection()
                               .AddTransient <BowlingSystem>()
                               .AddTransient <IPartyRepository, SqlPartyRepository>()
                               .AddTransient <IAccountabilityRepository, SqlAccountabilityRepository>()
                               .AddTransient <IAccountRepository, SqlAccountRepository>()
                               .AddSingleton <BowlingContext>(context)
                               .BuildServiceProvider();

            _context = new BowlingContext(optionsBuilder.Options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
        }
コード例 #3
0
        public BowlingSystem(
            IPartyRepository partyContext,
            IAccountabilityRepository accountabilityContext,
            IAccountRepository accountContext,
            BowlingContext bowlingContext)
        {
            _partyContext          = partyContext;
            _accountabilityContext = accountabilityContext;
            _accountContext        = accountContext;

            PrepareGameObjects();

            _bowlingContext = bowlingContext;

            _bowlingContext.AccountabilityTypes.Add(_gameType);
            _bowlingContext.Units.Add(_scoreUnit);
            _bowlingContext.PhenomenonTypes.Add(_phenomenonType);
            _bowlingContext.OakLanes.AddRange(_oakLanes);
            _bowlingContext.Lanes.AddRange(_lanes);

            _bowlingContext.SaveChanges();
        }
コード例 #4
0
 public TeamMembersController(BowlingContext context)
 {
     _context = context;
 }
コード例 #5
0
ファイル: GamesController.cs プロジェクト: aauraizee/Bowling
        public GamesController(BowlingContext context)
        {
            _context = context;

            _context.Database.EnsureCreated();
        }
コード例 #6
0
 public TeamViewComponent(BowlingContext ctx)
 {
     context = ctx;
 }
コード例 #7
0
 public YearAveragesController(BowlingContext context)
 {
     _context = context;
 }
コード例 #8
0
 public SqlPartyRepository(BowlingContext context)
 {
     _context = context;
 }
コード例 #9
0
 public GamesController(BowlingContext context)
 {
     _context = context;
 }
コード例 #10
0
 public BowlersController(BowlingContext context)
 {
     _context = context;
 }
コード例 #11
0
 public RecordStaticsController(BowlingContext context)
 {
     _context = context;
 }
コード例 #12
0
 public SqlAccountabilityRepository(BowlingContext context)
 {
     _context = context;
 }
コード例 #13
0
 public HomeController(ILogger <HomeController> logger, BowlingContext ctx)
 {
     _logger = logger;
     context = ctx;
 }