本文整理汇总了C#中IRepository类的典型用法代码示例。如果您正苦于以下问题:C# IRepository类的具体用法?C# IRepository怎么用?C# IRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRepository类属于命名空间,在下文中一共展示了IRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RepositoryFile
public RepositoryFile(IRepository repository, String path, RepositoryStatus contentsStatus, RepositoryStatus propertiesStatus)
{
if (path == null)
throw new ArgumentNullException("path");
if (path.Trim().Length == 0)
throw new ArgumentException("Path must be set to a valid path", "path");
if (path[path.Length-1] == '/')
throw new ArgumentException("Path must be set to a file, not a directory", "path");
if (propertiesStatus == RepositoryStatus.Added ||
propertiesStatus == RepositoryStatus.Deleted)
{
throw new ArgumentException("Properties status cannot be set to Added or Deleted, use Updated", "propertiesStatus");
}
this.contentsStatus = contentsStatus;
this.propertiesStatus = propertiesStatus;
this.repository = repository;
SetPathRelatedFields(path);
if (fileName.EndsWith(" "))
throw new ArgumentException("Filename cannot end with trailing spaces", "path");
if (fileName.StartsWith(" "))
throw new ArgumentException("Filename cannot begin with leading spaces", "path");
}
示例2: TaskController
public TaskController(IRepository<Task> tasks)
{
if (tasks == null)
throw new ArgumentNullException("tasks");
_tasks = tasks;
}
示例3: ProjectsService
public ProjectsService(
IRepository<SoftwareProject> projectsRepo,
IRepository<User> usersRepo)
{
this.projects = projectsRepo;
this.users = usersRepo;
}
示例4: BodyPartHandler
public BodyPartHandler(IRepository<BodyPartRecord> bodyRepository) {
Filters.Add(StorageFilter.For(bodyRepository));
OnIndexing<BodyPart>((context, bodyPart) => context.DocumentIndex
.Add("body", bodyPart.Record.Text).RemoveTags().Analyze()
.Add("format", bodyPart.Record.Format).Store());
}
示例5: NotificationService
/// <summary>
/// Ctor
/// </summary>
/// <param name="cacheManager">Cache manager</param>
/// <param name="notificationRepository">Notification repository</param>
/// <param name="eventPublisher">Event published</param>
public NotificationService(ICacheManager cacheManager,
IRepository<Notification> notificationRepository,
ISignals signals) {
_cacheManager = cacheManager;
_notificationRepository = notificationRepository;
_signals = signals;
}
示例6: PredictiveModelService
/// <summary>
/// Initializes a new instance of the <see cref="PredictiveModelService" /> class
/// </summary>
/// <param name="trainRepository">trainRepository parameter</param>
/// <param name="waterdataRepository">waterdataRepository parameter</param>
/// <param name="predictiveRepository">predictiveRepository parameter</param>
/// <param name="vesselRepository">vesselRepository parameter</param>
public PredictiveModelService(IRepository<train> trainRepository, IRepository<water_data> waterdataRepository, IPredictiveModelRepository predictiveRepository, IVesselRepository vesselRepository)
{
this.modifiedwaterdataRepository = waterdataRepository;
this.predictiveRepository = predictiveRepository;
this.modifiedTrainRepository = trainRepository;
this.modifiedVesselRepository = vesselRepository;
}
示例7: Init
public void Init(string email, IRepository repository)
{
if (!string.IsNullOrEmpty(email))
{
User = repository.GetUser(email);
}
}
示例8: PackageDataAggregateUpdater
public PackageDataAggregateUpdater(IRepository<PackageDataAggregate> packageDataAggregateRepository,
IRepository<PublishedPackage> publishedPackageRepository, IRepository<Package> packageRepository)
{
_packageDataAggregateRepository = packageDataAggregateRepository;
_packageRepository = packageRepository;
_publishedPackageRepository = publishedPackageRepository;
}
示例9: ThreadServices
public ThreadServices(
IRepository<Thread> threadRepository,
IRepository<ThreadView> threadViewRepository,
IRepository<Post> postRepository,
IRepository<User> userRepository,
IRepository<ThreadViewStamp> threadViewStampRepository,
IRepository<Subscription> subscriptionRepository,
IRepository<Attachment> attachmentRepository,
PollServices pollServices,
FileServices fileServices,
ParseServices parseServices,
RoleServices roleServices,
IUnitOfWork unitOfWork)
: base(unitOfWork)
{
_threadRepository = threadRepository;
_threadViewRepository = threadViewRepository;
_postRepository = postRepository;
_userRepository = userRepository;
_threadViewStampRepository = threadViewStampRepository;
_subscriptionRepository = subscriptionRepository;
_attachmentRepository = attachmentRepository;
_pollServices = pollServices;
_fileServices = fileServices;
_parseServices = parseServices;
_roleServices = roleServices;
}
示例10: CompilationsService
public CompilationsService(IRepositoryFactory repositoryFactory)
{
if(repositoryFactory == null)
throw new ArgumentNullException(nameof(repositoryFactory));
_compilationRepository = repositoryFactory.CreateCompilationRepository();
}
示例11: Creator
public Creator(IUnitOfWork unitOfWork, IRepository<Battle> repositoryOfBattle, IRepository<User> repositoryOfUser, IRepository<Team> repositoryOfTeam)
{
_unitOfWork = unitOfWork;
_repositoryOfBattle = repositoryOfBattle;
_repositoryOfUser = repositoryOfUser;
_repositoryOfTeam = repositoryOfTeam;
}
示例12: DefaultPageService
public DefaultPageService(IRepository repository, IRedirectService redirectService, IUrlService urlService)
{
this.repository = repository;
this.redirectService = redirectService;
this.urlService = urlService;
temporaryPageCache = new Dictionary<string, IPage>();
}
示例13: Before_Each_Test
public void Before_Each_Test()
{
console = MockRepository.GenerateMock<IConsoleFacade>();
repository = MockRepository.GenerateMock<IRepository<GameObject>>();
format = new Formatter(console, repository);
cmd = new DescribeCommand(console, repository, format);
}
示例14: PostsController
public PostsController(IRepository<Post> postsRepository, IRepository<User> usersRepository, IRepository<Tag> tagsRepository, IRepository<Comment> commentsRepository)
{
this.postsRepository = postsRepository;
this.usersRepository = usersRepository;
this.tagsRepository = tagsRepository;
this.commentsRepository = commentsRepository;
}
示例15: SecureLdapAuthenticationProvider
public SecureLdapAuthenticationProvider(IConfigSectionProvider configSectionProvider, ILocalEducationAgencyContextProvider localEducationAgencyContextProvider, IRepository<LocalEducationAgency> localEducationAgencyRepository, IRepository<LocalEducationAgencyAuthentication> localEducationAgencyAuthenticationRepository)
{
this.configSectionProvider = configSectionProvider;
this.localEducationAgencyContextProvider = localEducationAgencyContextProvider;
_localEducationAgencyRepository = localEducationAgencyRepository;
_localEducationAgencyAuthenticationRepository = localEducationAgencyAuthenticationRepository;
}