Exemple #1
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // it is NOT necessary to register your controllers


            //Bind the various domain model services and repositories that e.g. our controllers require
            container.BindInRequestScope <IUnitOfWork, UnitOfWork>();
            container.BindInRequestScope <IGenericRepository <Farmacia>, GenericRepository <Farmacia> >();

            container.RegisterType <DbContext, ApplicationDbContext>(
                new HierarchicalLifetimeManager());
            container.RegisterType <UserManager <ApplicationUser> >(
                new HierarchicalLifetimeManager());
            container.RegisterType <IUserStore <ApplicationUser>, UserStore <ApplicationUser> >(
                new HierarchicalLifetimeManager());

            container.RegisterType <AccountController>(
                new InjectionConstructor());
            //container.BindInRequestScope<ISessionHelper, SessionHelper>();

            return(container);
        }
Exemple #2
0
        private static IUnityContainer BuildUnityContainer()
        {
            UnityContainer container = new UnityContainer();

            container.BindInRequestScope <IFileManager, FileManager>();
            container.BindInRequestScope <ApplicationDbContext, ApplicationDbContext>();
            return(container);
        }
Exemple #3
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            container.BindInRequestScope <IDataContext, DataContext>();
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();
            container.BindInRequestScope <IRepository <UserProfileModel>, Repository <UserProfileModel> >();

            return(container);
        }
Exemple #4
0
    /// <summary>
    /// Inject
    /// </summary>
    /// <returns></returns>
    private static IUnityContainer BuildUnityContainer()
    {
        var container = new UnityContainer();

        // register all your components with the container here
        // it is NOT necessary to register your controllers
        // Database context, one per request, ensure it is disposed
        container.BindInRequestScope <IMVCForumContext, MVCForumContext>();
        container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();
        //Bind the various domain model services and repositories that e.g. our controllers require
        container.BindInRequestScope <ITopicService, TopicService>();
        container.BindInRequestScope <ITopicTagRepository, TopicTagRepository>();
        //container.BindInRequestScope<ISessionHelper, SessionHelper>();
        return(container);
    }
        /// <summary>
        /// Inject
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer(UnityContainer container)
        {
            // register all your components with the container here

            // Database context, one per request, ensure it is disposed
            container.BindInRequestScope <IDatabaseContext, DatabaseContext>();
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();

            //Bind the various domain model services and repositories that e.g. our scripts require
            container.BindInRequestScope <ICacheService, CacheService>();
            container.BindInRequestScope <ILoggingService, LoggingService>();

            CustomBindings(container);

            return(container);
        }
        public static void RegisterComponents()
        {
            var container = new UnityContainer();

            container.BindInRequestScope <IIncidentDataSource, HFDIncidentsReadOnlyContext>();

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }
Exemple #7
0
        public static void RegisterComponents()
        {
            var container = new UnityContainer();

            container.BindInRequestScope <IIncidentDataSource, HFDIncidentsReadOnlyContext>();

            DependencyResolver.SetResolver(new Unity.Mvc5.UnityDependencyResolver(container));

            GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(container);
        }
    private static IUnityContainer BuildUnityContainer()
    {
        var container = new UnityContainer();

        // register all your components with the container here
        // it is NOT necessary to register your controllers
        // Configuration object, one per request, ensure it is disposed
        container.BindInRequestScope <IChartConfiguration, ChartConfiguration>();
        return(container);
    }
Exemple #9
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // it is NOT necessary to register your controllers

            container.BindInRequestScope <IUserRepository, UserRepository>();

            //container.BindInRequestScope<ISessionHelper, SessionHelper>();

            return(container);
        }
Exemple #10
0
        /// <summary>
        /// Inject
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // it is NOT necessary to register your controllers

            // Database context, one per request, ensure it is disposed
            container.BindInRequestScope <IMVCForumContext, MVCForumContext>();
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();

            // Quartz
            container.AddNewExtension <QuartzUnityExtension>();

            //Bind the various domain model services and repositories that e.g. our controllers require
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();
            container.BindInRequestScope <IIntegrityServiceManager, IntegrityServiceManager>();
            container.BindInRequestScope <IRoleService, RoleService>();
            container.BindInRequestScope <ICategoryService, CategoryService>();
            container.BindInRequestScope <IMembershipService, MembershipService>();
            container.BindInRequestScope <IPermissionService, PermissionService>();
            container.BindInRequestScope <ISettingsService, SettingsService>();
            container.BindInRequestScope <ITopicService, TopicService>();
            container.BindInRequestScope <ITopicTagService, TopicTagService>();
            container.BindInRequestScope <IPostService, PostService>();
            container.BindInRequestScope <ILocalizationService, LocalizationService>();
            container.BindInRequestScope <IVoteService, VoteService>();
            container.BindInRequestScope <IBadgeService, BadgeService>();
            container.BindInRequestScope <IMembershipUserPointsService, MembershipUserPointsService>();
            container.BindInRequestScope <ICategoryPermissionForRoleService, CategoryPermissionForRoleService>();
            container.BindInRequestScope <ICategoryNotificationService, CategoryNotificationService>();
            container.BindInRequestScope <ITopicNotificationService, TopicNotificationService>();
            container.BindInRequestScope <IPrivateMessageService, PrivateMessageService>();
            container.BindInRequestScope <ILoggingService, LoggingService>();
            container.BindInRequestScope <IEmailService, EmailService>();
            container.BindInRequestScope <IReportService, ReportService>();
            container.BindInRequestScope <IActivityService, ActivityService>();
            container.BindInRequestScope <IPollService, PollService>();
            container.BindInRequestScope <IPollVoteService, PollVoteService>();
            container.BindInRequestScope <IPollAnswerService, PollAnswerService>();
            container.BindInRequestScope <IInstallerService, InstallerService>();
            container.BindInRequestScope <IBannedEmailService, BannedEmailService>();
            container.BindInRequestScope <IBannedWordService, BannedWordService>();
            container.BindInRequestScope <IUploadedFileService, UploadedFileService>();
            container.BindInRequestScope <IFavouriteService, FavouriteService>();
            container.BindInRequestScope <IGlobalPermissionForRoleService, GlobalPermissionForRoleService>();

            container.BindInRequestScope <IRoleRepository, RoleRepository>();
            container.BindInRequestScope <ICategoryRepository, CategoryRepository>();
            container.BindInRequestScope <IMembershipRepository, MembershipRepository>();
            container.BindInRequestScope <IPermissionRepository, PermissionRepository>();
            container.BindInRequestScope <ISettingsRepository, SettingsRepository>();
            container.BindInRequestScope <ITopicRepository, TopicRepository>();
            container.BindInRequestScope <ITopicTagRepository, TopicTagRepository>();
            container.BindInRequestScope <IPostRepository, PostRepository>();
            container.BindInRequestScope <ILocalizationRepository, LocalizationRepository>();
            container.BindInRequestScope <IVoteRepository, VoteRepository>();
            container.BindInRequestScope <IBadgeRepository, BadgeRepository>();
            container.BindInRequestScope <IMembershipUserPointsRepository, MembershipUserPointsRepository>();
            container.BindInRequestScope <ICategoryPermissionForRoleRepository, CategoryPermissionForRoleRepository>();
            container.BindInRequestScope <ICategoryNotificationRepository, CategoryNotificationRepository>();
            container.BindInRequestScope <ITopicNotificationRepository, TopicNotificationRepository>();
            container.BindInRequestScope <IPrivateMessageRepository, PrivateMessageRepository>();
            container.BindInRequestScope <IActivityRepository, ActivityRepository>();
            container.BindInRequestScope <IPollRepository, PollRepository>();
            container.BindInRequestScope <IPollVoteRepository, PollVoteRepository>();
            container.BindInRequestScope <IPollAnswerRepository, PollAnswerRepository>();
            container.BindInRequestScope <IInstallerRepository, InstallerRepository>();
            container.BindInRequestScope <IBannedEmailRepository, BannedEmailRepository>();
            container.BindInRequestScope <IBannedWordRepository, BannedWordRepository>();
            container.BindInRequestScope <IUploadedFileRepository, UploadedFileRepository>();
            container.BindInRequestScope <IFavouriteRepository, FavouriteRepository>();
            container.BindInRequestScope <IGlobalPermissionForRoleRepository, GlobalPermissionForRoleRepository>();
            container.BindInRequestScope <IEmailRepository, EmailRepository>();

            //container.BindInRequestScope<ISessionHelper, SessionHelper>();

            return(container);
        }
Exemple #11
0
        /// <summary>
        /// Inject
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer(UnityContainer container)
        {
            // register all your components with the container here
            // it is NOT necessary to register your controllers

            // Database context, one per request, ensure it is disposed
            container.BindInRequestScope <IChamberContext, ChamberContext>();
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();

            // Quartz
            //container.AddNewExtension<QuartzUnityExtension>();

            //Bind the various domain model services and repositories that e.g. our controllers require
            container.BindInRequestScope <IActivityService, ActivityService>();
            container.BindInRequestScope <IBusinessService, BusinessService>();
            container.BindInRequestScope <ICacheService, CacheService>();
            container.BindInRequestScope <IClassificationService, ClassificationService>();
            container.BindInRequestScope <IConfigService, ConfigService>();
            container.BindInRequestScope <IEmailService, EmailService>();
            container.BindInRequestScope <ILoggingService, LoggingService>();
            container.BindInRequestScope <IMembershipLevelService, MembershipLevelService>();
            container.BindInRequestScope <IMembershipService, MembershipService>();
            container.BindInRequestScope <IReflectionService, ReflectionService>();
            container.BindInRequestScope <IRoleService, RoleService>();
            container.BindInRequestScope <ISettingsService, SettingsService>();

            CustomBindings(container);

            return(container);
        }
Exemple #12
0
 private static void RegisterTypes(UnityContainer container)
 {
     //Bu kýsýmda oluþturulan Sýnýf,Service tanýmlanarak birden fazla kez nesne üretmenin önüne geçiþmektedir.Burada her sýnýf ve service tanýmlamasý yapýlarak birden fazla nesne üretmenin önüne geçilmektedir.
     container.BindInRequestScope <IUnitofWork, UnitofWork>();
     container.BindInRequestScope <ILoginService, LoginService>();
     container.BindInRequestScope <IStaffService, StaffService>();
     container.BindInRequestScope <IUserService, UserService>();
     container.BindInRequestScope <IAyarlarService, AyarService>();
     container.BindInRequestScope <ICarService, CarService>();
     container.BindInRequestScope <IMoneyEntryService, MoneyEntryService>();
     container.BindInRequestScope <ICustomerService, CustomerService>();
     container.BindInRequestScope <ISubscriberService, SubscriberService>();
     container.BindInRequestScope <IRepository <Uye>, Repository <Uye> >();
     container.BindInRequestScope <IRepository <Personel>, Repository <Personel> >();
     container.BindInRequestScope <IRepository <Abone>, Repository <Abone> >();
     container.BindInRequestScope <IRepository <AboneGiriCikis>, Repository <AboneGiriCikis> >();
     container.BindInRequestScope <IRepository <Ayarlar>, Repository <Ayarlar> >();
     container.BindInRequestScope <IRepository <Arac>, Repository <Arac> >();
     container.BindInRequestScope <IRepository <KaraListe>, Repository <KaraListe> >();
     container.BindInRequestScope <IRepository <Musteri>, Repository <Musteri> >();
     container.BindInRequestScope <IRepository <MusteriPark>, Repository <MusteriPark> >();
     container.BindInRequestScope <IRepository <MusteriYikama>, Repository <MusteriYikama> >();
     container.BindInRequestScope <IRepository <Gelirler>, Repository <Gelirler> >();
 }
Exemple #13
0
        /// <summary>
        /// Inject
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer(UnityContainer container)
        {
            // register all your components with the container here
            // it is NOT necessary to register your controllers

            // Database context, one per request, ensure it is disposed
            container.BindInRequestScope <IMVCForumContext, MVCForumContext>();
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();


            // Quartz
            container.AddNewExtension <QuartzUnityExtension>();

            //Bind the various domain model services and repositories that e.g. our controllers require
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();
            container.BindInRequestScope <IRoleService, RoleService>();
            container.BindInRequestScope <ICategoryService, CategoryService>();
            container.BindInRequestScope <IMembershipService, MembershipService>();
            container.BindInRequestScope <IPermissionService, PermissionService>();
            container.BindInRequestScope <ISettingsService, SettingsService>();
            container.BindInRequestScope <ITopicService, TopicService>();
            container.BindInRequestScope <ITopicTagService, TopicTagService>();
            container.BindInRequestScope <IPostService, PostService>();
            container.BindInRequestScope <ILocalizationService, LocalizationService>();
            container.BindInRequestScope <IVoteService, VoteService>();
            container.BindInRequestScope <IBadgeService, BadgeService>();
            container.BindInRequestScope <IMembershipUserPointsService, MembershipUserPointsService>();
            container.BindInRequestScope <ICategoryPermissionForRoleService, CategoryPermissionForRoleService>();
            container.BindInRequestScope <ICategoryNotificationService, CategoryNotificationService>();
            container.BindInRequestScope <ITopicNotificationService, TopicNotificationService>();
            container.BindInRequestScope <IPrivateMessageService, PrivateMessageService>();
            container.BindInRequestScope <ILoggingService, LoggingService>();
            container.BindInRequestScope <IEmailService, EmailService>();
            container.BindInRequestScope <IReportService, ReportService>();
            container.BindInRequestScope <IActivityService, ActivityService>();
            container.BindInRequestScope <IPollService, PollService>();
            container.BindInRequestScope <IPollVoteService, PollVoteService>();
            container.BindInRequestScope <IPollAnswerService, PollAnswerService>();
            container.BindInRequestScope <IBannedEmailService, BannedEmailService>();
            container.BindInRequestScope <IBannedWordService, BannedWordService>();
            container.BindInRequestScope <IUploadedFileService, UploadedFileService>();
            container.BindInRequestScope <IFavouriteService, FavouriteService>();
            container.BindInRequestScope <IGlobalPermissionForRoleService, GlobalPermissionForRoleService>();
            container.BindInRequestScope <ICacheService, CacheService>();
            container.BindInRequestScope <ITagNotificationService, TagNotificationService>();
            container.BindInRequestScope <IReflectionService, ReflectionService>();
            container.BindInRequestScope <IBlockService, BlockService>();
            container.BindInRequestScope <IConfigService, ConfigService>();
            container.BindInRequestScope <IPostEditService, PostEditService>();
            container.BindInRequestScope <IOnePosService, OnePosService>();

            CustomBindings(container);

            return(container);
        }
Exemple #14
0
        /// <summary>
        /// Inject
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer(UnityContainer container)
        {
            // register all your components with the container here
            // it is NOT necessary to register your controllers

            container.BindInRequestScope <IWebMvcContext, WebMvcContext>();
            container.BindInRequestScope <IUnitOfWorkManager, UnitOfWorkManager>();

            // Quartz
            container.AddNewExtension <QuartzUnityExtension>();

            //Bind the various domain model services and repositories that e.g. our controllers require
            container.BindInRequestScope <ILoggingService, LoggingService>();
            container.BindInRequestScope <ICacheService, CacheService>();
            container.BindInRequestScope <IMembershipService, MembershipService>();
            container.BindInRequestScope <ISettingsService, SettingsService>();
            container.BindInRequestScope <IConfigService, ConfigService>();
            container.BindInRequestScope <ILocalizationService, LocalizationService>();
            container.BindInRequestScope <ICategoryService, CategoryService>();
            container.BindInRequestScope <ITopicService, TopicService>();
            container.BindInRequestScope <IPostSevice, PostSevice>();
            container.BindInRequestScope <IProductPostSevice, ProductPostSevice>();
            container.BindInRequestScope <IRoleSevice, RoleSevice>();
            container.BindInRequestScope <IPermissionService, PermissionService>();
            container.BindInRequestScope <IContactService, ContactService>();
            container.BindInRequestScope <IBookingSevice, BookingSevice>();
            container.BindInRequestScope <ITypeRoomSevice, TypeRoomSevice>();
            container.BindInRequestScope <IProductSevice, ProductSevice>();
            container.BindInRequestScope <IEmployeesService, EmployeesService>();
            container.BindInRequestScope <IEmployeesRoleService, EmployeesRoleService>();
            container.BindInRequestScope <IShoppingCartService, ShoppingCartService>();
            container.BindInRequestScope <IShoppingCartProductService, ShoppingCartProductService>();
            container.BindInRequestScope <IMenuService, MenuService>();


            CustomBindings(container);

            return(container);
        }