/// <summary>
        /// Register all service with its implementation
        /// </summary>
        /// <param name="containerRegistry">Container registry.</param>
        private void RegisterServices(IContainerRegistry containerRegistry)
        {
            containerRegistry.Register <IStartupService, StartupService>();

            /* ==================================================================================================
             * Register for api gateway, use register instance
             * ================================================================================================*/
            //containerRegistry.RegisterInstance(RestServiceHelper.GetApi<IPhotoApi>());
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IUserApi>());
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IOrgsApi>());
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IApiTokenApi>());
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IInvitationsApi>());
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IAppsApi>());
            RegisterAppCenterApis(containerRegistry);

            /* ==================================================================================================
             * register logic services which using for app
             * ...
             * ================================================================================================*/
            containerRegistry.Register <IUserService, UserService>();
            containerRegistry.Register <IOrgsService, OrgsService>();
            containerRegistry.Register <IApiTokenService, ApiTokenService>();
            containerRegistry.Register <IInvitationsService, InvitationsService>();
            containerRegistry.Register <IAppsService, AppsService>();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Register all service with its implementation
        /// </summary>
        /// <param name="containerRegistry">Container registry.</param>
        private void RegisterServices(IContainerRegistry containerRegistry)
        {
            containerRegistry.Register <IStartupService, StartupService>();
            containerRegistry.Register <ISecurityService, SecurityService>();
            containerRegistry.Register <IPatientService, PatientService>();
            containerRegistry.Register <IPhotoService, PhotoService>();
            containerRegistry.Register <IPostService, PostService>();

            /* ==================================================================================================
             * Register for api gateway, use register instance
             * ================================================================================================*/
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IPhotoApi>());
            containerRegistry.RegisterInstance(RestServiceHelper.GetApi <IPostsApi>());

            /* ==================================================================================================
             * todo: register logic services which using for app
             * ...
             * ================================================================================================*/
        }
 public static void RegisterAppCenterApi <T>(this IContainerRegistry containerRegistry)
 {
     containerRegistry.RegisterInstance(RestServiceHelper.GetApi <T>());
 }