• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IRepository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IRepository的典型用法代码示例。如果您正苦于以下问题:C# IRepository类的具体用法?C# IRepository怎么用?C# IRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IRepository类属于命名空间,在下文中一共展示了IRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GenericCharacteristicService

 //private readonly ILifetimeScope container;
 public GenericCharacteristicService()
 {
     //this.container = AutofacHostFactory.Container;
     this.genericCharacteristicRepository =
         EngineContext.Current.Resolve<IRepository<GenericCharacteristic>>();
     this.cacheManager = EngineContext.Current.Resolve<ICacheManager>();
 }
开发者ID:popunit,项目名称:MyEFramework,代码行数:8,代码来源:GenericCharacteristicService.cs


示例17: VendorService

 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="vendorRepository">Vendor repository</param>
 /// <param name="eventPublisher">Event published</param>
 public VendorService(IRepository<Vendor> vendorRepository,
     IEventPublisher eventPublisher, IRepository<Customer> customerRepository)
 {
     this._vendorRepository = vendorRepository;
     this._eventPublisher = eventPublisher;
     this._customerRepository = customerRepository;
 }
开发者ID:chamithdev,项目名称:AntiquesWeb,代码行数:12,代码来源:VendorService.cs


示例18: PostPartHandler

        public PostPartHandler(IRepository<PostPartRecord> repository, 
            IPostService postService, 
            IThreadService threadService, 
            IForumService forumService,
            IClock clock) {
            _postService = postService;
            _threadService = threadService;
            _forumService = forumService;
            _clock = clock;

            Filters.Add(StorageFilter.For(repository));

            OnGetDisplayShape<PostPart>(SetModelProperties);
            OnGetEditorShape<PostPart>(SetModelProperties);
            OnUpdateEditorShape<PostPart>(SetModelProperties);

            OnCreated<PostPart>((context, part) => UpdateCounters(part));
            OnPublished<PostPart>((context, part) => { 
                UpdateCounters(part);
                UpdateThreadVersioningDates(part);
            });
            OnUnpublished<PostPart>((context, part) => UpdateCounters(part));
            OnVersioned<PostPart>((context, part, newVersionPart) => UpdateCounters(newVersionPart));
            OnRemoved<PostPart>((context, part) => UpdateCounters(part));

            OnRemoved<ThreadPart>((context, b) =>
                _postService.Delete(context.ContentItem.As<ThreadPart>()));

            OnIndexing<PostPart>((context, postPart) => context.DocumentIndex
                                                    .Add("body", postPart.Record.Text).RemoveTags().Analyze()
                                                    .Add("format", postPart.Record.Format).Store());
        }
开发者ID:six006,项目名称:NGM.Forum,代码行数:32,代码来源:PostPartHandler.cs


示例19: SetUp

        public void SetUp()
        {
            _mockRepository = new MockRepository();
            _tagRepository = _mockRepository.DynamicMock<IRepository<Tag>>();

            _tagService = new TagService(_tagRepository);
        }
开发者ID:aquiladev,项目名称:MetalMastery,代码行数:7,代码来源:TagServiceTests.cs


示例20: ExecuteWithData

        protected override bool ExecuteWithData(string cmd, IRepository repo, Player player)
        {
            string[] cmdArray = cmd.Split(new[] { ' ' }, 2);

            string name = "";
            if (cmdArray.GetUpperBound(0) >= 1)
                name = cmdArray[1].Trim();

            GameObject target;

            switch (name.ToLower())
            {
                case "here":
                case "":
                    target = player.Location;
                    break;
                default:
                    target = queries.FindNearPlayer(repo, player, name);
                    break;
            }

            if (target == null)
            {
                console.WriteLine(STR_NoSuchObject, name);
                return false;
            }

            formatters.OfType<LookFormatter>().First().Format(target);
            formatters.OfType<InventoryFormatter>().First().Format(target);
            return false;
        }
开发者ID:trayburn,项目名称:Adventure,代码行数:31,代码来源:LookCommand.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IRepositoryFactory类代码示例发布时间:2022-05-24
下一篇:
C# IReportViolations类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap