BolfTracker.Web.App_Start.UnityConfig.RegisterTypes C# (CSharp) Метод

RegisterTypes() публичный статический Метод

Registers the type mappings with the Unity container.
There is no need to register concrete types such as controllers or API controllers (unless you want to change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.
public static RegisterTypes ( IUnityContainer container ) : void
container IUnityContainer The unity container to configure.
Результат void
        public static void RegisterTypes(IUnityContainer container)
        {
            // Register all of the needed services
            container.RegisterType<IPlayerService, PlayerService>()
                     .RegisterType<IGameService, GameService>()
                     .RegisterType<IHoleService, HoleService>()
                     .RegisterType<IShotService, ShotService>()
                     .RegisterType<IShotTypeService, ShotTypeService>()
                     .RegisterType<IRankingService, RankingService>();

            // Register all of the needed repositories
            container.RegisterType<IGameRepository, GameRepository>()
                     .RegisterType<IPlayerRepository, PlayerRepository>()
                     .RegisterType<IHoleRepository, HoleRepository>()
                     .RegisterType<IShotRepository, ShotRepository>()
                     .RegisterType<IRankingRepository, RankingRepository>()
                     .RegisterType<IGameStatisticsRepository, GameStatisticsRepository>()
                     .RegisterType<IPlayerStatisticsRepository, PlayerStatisticsRepository>()
                     .RegisterType<IHoleStatisticsRepository, HoleStatisticsRepository>()
                     .RegisterType<IPlayerHoleStatisticsRepository, PlayerHoleStatisticsRepository>()
                     .RegisterType<IPlayerGameStatisticsRepository, PlayerGameStatisticsRepository>()
                     .RegisterType<IPlayerCareerStatisticsRepository, PlayerCareerStatisticsRepository>()
                     .RegisterType<IPlayerRivalryStatisticsRepository, PlayerRivalryStatisticsRepository>()
                     .RegisterType<IShotTypeRepository, ShotTypeRepository>(); 
        }
    }