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


C# IRepository类代码示例

本文整理汇总了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");

		}
开发者ID:atczyc,项目名称:castle,代码行数:26,代码来源:RepositoryFile.cs

示例2: TaskController

        public TaskController(IRepository<Task> tasks)
        {
            if (tasks == null)
                throw new ArgumentNullException("tasks");

            _tasks = tasks;
        }
开发者ID:RoymanJing,项目名称:Autofac,代码行数:7,代码来源:TaskController.cs

示例3: ProjectsService

 public ProjectsService(
     IRepository<SoftwareProject> projectsRepo,
     IRepository<User> usersRepo)
 {
     this.projects = projectsRepo;
     this.users = usersRepo;
 }
开发者ID:Vyara,项目名称:Web-Services-and-Cloud,代码行数:7,代码来源:ProjectsService.cs

示例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());
        }
开发者ID:Higea,项目名称:Orchard,代码行数:7,代码来源:BodyPartHandler.cs

示例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;
 }
开发者ID:hsb0307,项目名称:Nut.NET,代码行数:13,代码来源:NotificationService.cs

示例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;
 }
开发者ID:amodedude,项目名称:RTI-Web-Applicaotin,代码行数:14,代码来源:PredictiveModelService.cs

示例7: Init

 public void Init(string email, IRepository repository)
 {
     if (!string.IsNullOrEmpty(email))
     {
         User = repository.GetUser(email);
     }
 }
开发者ID:peinguin,项目名称:online_shop,代码行数:7,代码来源:UserIdentity.cs

示例8: PackageDataAggregateUpdater

 public PackageDataAggregateUpdater(IRepository<PackageDataAggregate> packageDataAggregateRepository,
     IRepository<PublishedPackage> publishedPackageRepository, IRepository<Package> packageRepository)
 {
     _packageDataAggregateRepository = packageDataAggregateRepository;
     _packageRepository = packageRepository;
     _publishedPackageRepository = publishedPackageRepository;
 }
开发者ID:dioptre,项目名称:nkd,代码行数:7,代码来源:PackageDataAggregateUpdater.cs

示例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;
 }
开发者ID:anton-nesterenko,项目名称:mesoBoard,代码行数:27,代码来源:ThreadServices.cs

示例10: CompilationsService

        public CompilationsService(IRepositoryFactory repositoryFactory)
        {
            if(repositoryFactory == null)
                throw new ArgumentNullException(nameof(repositoryFactory));

            _compilationRepository = repositoryFactory.CreateCompilationRepository();
        }
开发者ID:netstalkerrr,项目名称:SoundTube,代码行数:7,代码来源:CompilationsService.cs

示例11: Creator

 public Creator(IUnitOfWork unitOfWork, IRepository<Battle> repositoryOfBattle, IRepository<User> repositoryOfUser, IRepository<Team> repositoryOfTeam)
 {
     _unitOfWork = unitOfWork;
     _repositoryOfBattle = repositoryOfBattle;
     _repositoryOfUser = repositoryOfUser;
     _repositoryOfTeam = repositoryOfTeam;
 }
开发者ID:meze,项目名称:betteamsbattle,代码行数:7,代码来源:Creator.cs

示例12: DefaultPageService

 public DefaultPageService(IRepository repository, IRedirectService redirectService, IUrlService urlService)
 {
     this.repository = repository;
     this.redirectService = redirectService;
     this.urlService = urlService;
     temporaryPageCache = new Dictionary<string, IPage>();
 }
开发者ID:navid60,项目名称:BetterCMS,代码行数:7,代码来源:DefaultPageService.cs

示例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);
 }
开发者ID:csjackson,项目名称:Adventure,代码行数:7,代码来源:DescribeCommandTest.cs

示例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;
 }
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:PostsController.cs

示例15: SecureLdapAuthenticationProvider

 public SecureLdapAuthenticationProvider(IConfigSectionProvider configSectionProvider, ILocalEducationAgencyContextProvider localEducationAgencyContextProvider, IRepository<LocalEducationAgency> localEducationAgencyRepository, IRepository<LocalEducationAgencyAuthentication> localEducationAgencyAuthenticationRepository)
 {
     this.configSectionProvider = configSectionProvider;
     this.localEducationAgencyContextProvider = localEducationAgencyContextProvider;
     _localEducationAgencyRepository = localEducationAgencyRepository;
     _localEducationAgencyAuthenticationRepository = localEducationAgencyAuthenticationRepository;
 }
开发者ID:sybrix,项目名称:EdFi-App,代码行数:7,代码来源:SecureLdapAuthenticationProvider.cs


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