Esempio n. 1
0
        public static void RegisterComponents(ConnectionStringSettingsCollection connectionStrings)
        {
            var container = new UnityContainer();

            var connectionStringSettings = connectionStrings[nameof(FootballLeagueDbContext)];
            var dbInstance = new FootballLeagueDbContext(connectionStringSettings.ConnectionString);

            container.RegisterInstance(dbInstance)
            .RegisterSingleton <IRepository, FootballLeagueRepository>()
            .RegisterSingleton <IPointsCalculator, PointsCalculator>()
            .RegisterSingleton <ITeamsService, TeamsService>()
            .RegisterSingleton <IMatchesService, MatchesService>();

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }
Esempio n. 2
0
 public StandingsService(FootballLeagueDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 3
0
 public TeamsRepository(FootballLeagueDbContext footballLeagueDbContext)
     : base(footballLeagueDbContext)
 {
     this.footballLeagueDbContext = footballLeagueDbContext;
 }
 public BaseEntityRepository(FootballLeagueDbContext footballLeagueDbContext)
 {
     this.footballLeagueDbContext = footballLeagueDbContext;
 }
 public TeamService(FootballLeagueDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 6
0
 public ServiceBase(FootballLeagueDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Esempio n. 7
0
 public FootballLeagueRepository(FootballLeagueDbContext context)
 {
     this.context = context;
 }
Esempio n. 8
0
 public RepositoryBase()
 {
     this.context      = new FootballLeagueDbContext();
     this.shareContext = true;
 }
 public ResultService(FootballLeagueDbContext dbContext, IStandingsService standingsService) : base(dbContext)
 {
     _standingsService = standingsService;
 }