本文整理汇总了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>();
}
示例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"]);
}
示例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;
}
示例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;
}
示例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;
}
示例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>();
}
示例7: ConfigSetTask
public ConfigSetTask(IRepositoryFactory repositoryFactory, IEnvironmentTasks environmentTasks)
{
this.cacheController = cacheController;
this.environmentTasks = environmentTasks;
Repository = repositoryFactory.GetRepository();
Repository.SavingChanges += SavingChanges;
}
示例8: UserService
public UserService(IRepositoryFactory repositoryFactory, ICacheProvider cacheProvider)
{
_cacheProvider = cacheProvider;
_repositoryFactory = repositoryFactory;
_userRepository = repositoryFactory.GetRepository<BOUser, BOUserCollection>();
}
示例9: RoleService
public RoleService(ICacheProvider cacheProvider, IRepositoryFactory repositoryFactory)
{
_repositoryFactory = repositoryFactory;
_cacheProvider = cacheProvider;
_roleRepository = _repositoryFactory.GetRepository<BORole, BORoleCollection>();
}
示例10: LocalizationService
public LocalizationService(ICacheProvider cacheProvider, IRepositoryFactory repositoryFactory)
{
_cacheProvider = cacheProvider;
_repositoryFactory = repositoryFactory;
_localizationResourceRepository = repositoryFactory.GetRepository<BOLocalizationResource, BOLocalizationResourceCollection>();
}
示例11: AccountService
public AccountService(IRepositoryFactory repositoryFactory, ISettingService settingService, IUserService userService)
{
_repositoryFactory = repositoryFactory;
_userRepository = _repositoryFactory.GetRepository<BOUser, BOUserCollection>();
_settingService = settingService;
_userService = userService;
}
示例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);
}
示例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();
}
示例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"));
}
}
示例15: CultureService
public CultureService(IRepositoryFactory repositoryFactory)
{
_repositoryFactory = repositoryFactory;
_cultureRepository = repositoryFactory.GetRepository<BOCulture, BOCultureCollection>();
}