当前位置: 首页>>代码示例>>C#>>正文


C# IRepositoryFactory.GetRepository方法代码示例

本文整理汇总了C#中IRepositoryFactory.GetRepository方法的典型用法代码示例。如果您正苦于以下问题:C# IRepositoryFactory.GetRepository方法的具体用法?C# IRepositoryFactory.GetRepository怎么用?C# IRepositoryFactory.GetRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRepositoryFactory的用法示例。


在下文中一共展示了IRepositoryFactory.GetRepository方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EventService

 public EventService(IRepositoryFactory factory)
 {
     _personPersonRepo = factory.GetRepository<Person>();
     _gameRepository = factory.GetRepository<Game>();
     _foodRepository = factory.GetRepository<FoodItem>();
     _invitationRepository = factory.GetRepository<PendingInvitation>();
 }
开发者ID:sbutler-nerdery,项目名称:my-event-planner,代码行数:7,代码来源:EventService.cs

示例2: NotificationService

 public NotificationService(IRepositoryFactory factory)
 {
     _personRepository = factory.GetRepository<Person>();
     _eventRepository = factory.GetRepository<Event>();
     _invitationRepository = factory.GetRepository<PendingInvitation>();
     _emailClient = new SmtpClient();
     _useSendGrid = bool.Parse(ConfigurationManager.AppSettings["MailWithSendGrid"]);
 }
开发者ID:sbutler-nerdery,项目名称:my-event-planner,代码行数:8,代码来源:NotificationService.cs

示例3: EventController

 public EventController(IRepositoryFactory factory,
     IEventService service, IUserService userService, INotificationService notificationService)
 {
     _eventRepository = factory.GetRepository<Event>();
     _personRepository = factory.GetRepository<Person>();
     _eventService = service;
     _userService = userService;
     _notificationService = notificationService;
 }
开发者ID:sbutler-nerdery,项目名称:my-event-planner,代码行数:9,代码来源:EventController.cs

示例4: ServiceController

 public ServiceController(IRepositoryFactory factory, IUserService userService, IEventService eventService)
 {
     _eventRepository = factory.GetRepository<Event>();
     _personRepository = factory.GetRepository<Person>();
     _foodRepository = factory.GetRepository<FoodItem>();
     _gameRepository = factory.GetRepository<Game>();
     _inviteRepository = factory.GetRepository<PendingInvitation>();
     _userService = userService;
     _eventService = eventService;
 }
开发者ID:sbutler-nerdery,项目名称:my-event-planner,代码行数:10,代码来源:ServiceController.cs

示例5: HomeController

 public HomeController(IRepositoryFactory factory, IUserService userService, INotificationService notificationService,
     IEventService eventService)
 {
     _personRepository = factory.GetRepository<Person>();
     _eventRepository = factory.GetRepository<Event>();
     _foodRepository = factory.GetRepository<FoodItem>();
     _gameRepository = factory.GetRepository<Game>();
     _userService = userService;
     _notificationService = notificationService;
     _eventService = eventService;
 }
开发者ID:sbutler-nerdery,项目名称:my-event-planner,代码行数:11,代码来源:HomeController.cs

示例6: RightService

        public RightService(ICacheProvider cacheProvider, IRepositoryFactory repositoryFactory, IRoleService roleService)
        {
            _cacheProvider = cacheProvider;

            _repositoryFactory = repositoryFactory;

            _rightRepository = repositoryFactory.GetRepository<BORight, BORightCollection>();

            _roleService = roleService;

            _userRoleRepository = _repositoryFactory.GetRepository<BOUserRole, BOUserRoleCollection>();

            _roleRepository = _repositoryFactory.GetRepository<BORole, BORoleCollection>();
        }
开发者ID:TrevorVonSeggern,项目名称:Dota-Betting-ELO,代码行数:14,代码来源:RightService.cs

示例7: ConfigSetTask

 public ConfigSetTask(IRepositoryFactory repositoryFactory, IEnvironmentTasks environmentTasks)
 {
     this.cacheController = cacheController;
     this.environmentTasks = environmentTasks;
     Repository = repositoryFactory.GetRepository();
     Repository.SavingChanges += SavingChanges;
 }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:7,代码来源:ConfigSetTask.cs

示例8: UserService

        public UserService(IRepositoryFactory repositoryFactory, ICacheProvider cacheProvider)
        {
            _cacheProvider = cacheProvider;

            _repositoryFactory = repositoryFactory;

            _userRepository = repositoryFactory.GetRepository<BOUser, BOUserCollection>();
        }
开发者ID:TrevorVonSeggern,项目名称:Dota-Betting-ELO,代码行数:8,代码来源:UserService.cs

示例9: RoleService

        public RoleService(ICacheProvider cacheProvider, IRepositoryFactory repositoryFactory)
        {
            _repositoryFactory = repositoryFactory;

            _cacheProvider = cacheProvider;

            _roleRepository = _repositoryFactory.GetRepository<BORole, BORoleCollection>();
        }
开发者ID:TrevorVonSeggern,项目名称:Dota-Betting-ELO,代码行数:8,代码来源:RoleService.cs

示例10: LocalizationService

        public LocalizationService(ICacheProvider cacheProvider, IRepositoryFactory repositoryFactory)
        {
            _cacheProvider = cacheProvider;

            _repositoryFactory = repositoryFactory;

            _localizationResourceRepository = repositoryFactory.GetRepository<BOLocalizationResource, BOLocalizationResourceCollection>();
        }
开发者ID:TrevorVonSeggern,项目名称:Dota-Betting-ELO,代码行数:8,代码来源:LocalizationService.cs

示例11: AccountService

        public AccountService(IRepositoryFactory repositoryFactory, ISettingService settingService, IUserService userService)
        {
            _repositoryFactory = repositoryFactory;

            _userRepository = _repositoryFactory.GetRepository<BOUser, BOUserCollection>();

            _settingService = settingService;
            _userService = userService;
        }
开发者ID:TrevorVonSeggern,项目名称:Dota-Betting-ELO,代码行数:9,代码来源:AccountService.cs

示例12: SpinUp

        public void SpinUp()
        {
            RepositoryFactory = A.Fake<IRepositoryFactory>();
            PersonRepo = A.Fake<IRepository<Person>>();
            EventRepo = A.Fake<IRepository<Event>>();
            InvitationRepo = A.Fake<IRepository<PendingInvitation>>();
            FoodRepo = A.Fake<IRepository<FoodItem>>();
            GameRepo = A.Fake<IRepository<Game>>();
            UserService = A.Fake<IUserService>();

            A.CallTo(() => RepositoryFactory.GetRepository<Person>()).Returns(PersonRepo);
            A.CallTo(() => RepositoryFactory.GetRepository<Event>()).Returns(EventRepo);
            A.CallTo(() => RepositoryFactory.GetRepository<PendingInvitation>()).Returns(InvitationRepo);
            A.CallTo(() => RepositoryFactory.GetRepository<FoodItem>()).Returns(FoodRepo);
            A.CallTo(() => RepositoryFactory.GetRepository<Game>()).Returns(GameRepo);

            EventService = new EventService(RepositoryFactory);
            NotifyService = new NotificationService(RepositoryFactory);
        }
开发者ID:sbutler-nerdery,项目名称:my-event-planner,代码行数:19,代码来源:BaseTestFixture.cs

示例13: LiveScmEditorController

 public LiveScmEditorController(ITracer tracer,
                                IDeploymentManager deploymentManager,
                                IOperationLock operationLock,
                                IEnvironment environment,
                                IRepository repository,
                                IRepositoryFactory repositoryFactory)
     : base(tracer, environment, environment.RepositoryPath)
 {
     _deploymentManager = deploymentManager;
     _operationLock = operationLock;
     _repository = repository ?? repositoryFactory.GetRepository();
 }
开发者ID:albertjan,项目名称:kudu,代码行数:12,代码来源:LiveScmEditorController.cs

示例14: Seed

        public async static void Seed(IRepositoryFactory repoFactory)
        {
            var users = repoFactory.GetRepository<User>("AspNetUsers");

            var allUsers = await users.All();
            if (!allUsers.Any())
            {
                var john = new User("[email protected]");
                var userStore = new MongoUserStore<User>(repoFactory);
                var userManager = new ApplicationUserManager(userStore);
                var jimi = new User("[email protected]");

                var johnResult = await userManager.CreateAsync(john, "JohnsPassword");
                var jimiResult = await userManager.CreateAsync(jimi, "JimisPassword");

                await userManager.AddClaimAsync(john.Id, new Claim(ClaimTypes.Name, "[email protected]"));
                await userManager.AddClaimAsync(john.Id, new Claim(ClaimTypes.Role, "Admin"));

                await userManager.AddClaimAsync(jimi.Id, new Claim(ClaimTypes.Name, "[email protected]"));
                await userManager.AddClaimAsync(jimi.Id, new Claim(ClaimTypes.Role, "User"));
            }
        }
开发者ID:NasC0,项目名称:LeagueComparer,代码行数:22,代码来源:SeedMongoDatabase.cs

示例15: CultureService

        public CultureService(IRepositoryFactory repositoryFactory)
        {
            _repositoryFactory = repositoryFactory;

            _cultureRepository = repositoryFactory.GetRepository<BOCulture, BOCultureCollection>();
        }
开发者ID:TrevorVonSeggern,项目名称:Dota-Betting-ELO,代码行数:6,代码来源:CultureService.cs


注:本文中的IRepositoryFactory.GetRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。