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)); }
public StandingsService(FootballLeagueDbContext dbContext) : base(dbContext) { }
public TeamsRepository(FootballLeagueDbContext footballLeagueDbContext) : base(footballLeagueDbContext) { this.footballLeagueDbContext = footballLeagueDbContext; }
public BaseEntityRepository(FootballLeagueDbContext footballLeagueDbContext) { this.footballLeagueDbContext = footballLeagueDbContext; }
public TeamService(FootballLeagueDbContext dbContext) : base(dbContext) { }
public ServiceBase(FootballLeagueDbContext dbContext) { _dbContext = dbContext; }
public FootballLeagueRepository(FootballLeagueDbContext context) { this.context = context; }
public RepositoryBase() { this.context = new FootballLeagueDbContext(); this.shareContext = true; }
public ResultService(FootballLeagueDbContext dbContext, IStandingsService standingsService) : base(dbContext) { _standingsService = standingsService; }