Exemple #1
1
		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");

		}
 public ApplicationService(IRepository<Application> applicationRepository,
     IEventPublisher eventPublisher, ICacheManager cacheManager)
 {
     _applicationRepository = applicationRepository;
     _eventPublisher = eventPublisher;
     _cacheManager = cacheManager;
 }
        public FaqHandler(IRepository<FaqPartRecord> repository)
        {
            Filters.Add(StorageFilter.For(repository));
            OnRemoved<FaqPart>((context, part) => repository.Delete(part.Record));

            OnIndexing<FaqPart>((context, contactPart) => context.DocumentIndex.Add("faq_question", contactPart.Question).Analyze().Store());
        }
Exemple #4
0
        public TaskController(IRepository<Task> tasks)
        {
            if (tasks == null)
                throw new ArgumentNullException("tasks");

            _tasks = tasks;
        }
 public void Initialise()
 {
     _blogRepo = new SimpleRepository<Data.Blog>(new InMemoryRepositoryDataSource<Data.Blog>(new List<Data.Blog> { new Data.Blog { Id = 1, AuthoritiveUrl = "http://blog.test.con" } }));
     _templateRepo =  new SimpleRepository<BlogTemplate>(new InMemoryRepositoryDataSource<BlogTemplate>());
     _mockHttpContext = new Mock<IHttpContextService>();
     _mockHttpContext.Setup(h => h.RequestUrl).Returns(new Uri("http://blog.test.con/blah"));
 }
 public VendorAddressService(
     IRepository<VendorAddress> vendorAddressRepo,
     IEventPublisher eventPublisher)
 {
     _vendorAddressRepo = vendorAddressRepo;
     _eventPublisher = eventPublisher;
 }
 public ProjectsService(
     IRepository<SoftwareProject> projectsRepo,
     IRepository<User> usersRepo)
 {
     this.projects = projectsRepo;
     this.users = usersRepo;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="sciRepository">Shopping cart repository</param>
 /// <param name="workContext">Work context</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="productService">Product settings</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="checkoutAttributeService">Checkout attribute service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="eventPublisher">Event publisher</param>
 /// <param name="permissionService">Permission service</param>
 /// <param name="aclService">ACL service</param>
 public ShoppingCartService(IRepository<ShoppingCartItem> sciRepository,
     IWorkContext workContext, ICurrencyService currencyService,
     IProductService productService, ILocalizationService localizationService,
     IProductAttributeParser productAttributeParser,
     ICheckoutAttributeService checkoutAttributeService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IPriceFormatter priceFormatter,
     ICustomerService customerService,
     ShoppingCartSettings shoppingCartSettings,
     IEventPublisher eventPublisher,
     IPermissionService permissionService, 
     IAclService aclService)
 {
     this._sciRepository = sciRepository;
     this._workContext = workContext;
     this._currencyService = currencyService;
     this._productService = productService;
     this._localizationService = localizationService;
     this._productAttributeParser = productAttributeParser;
     this._checkoutAttributeService = checkoutAttributeService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._priceFormatter = priceFormatter;
     this._customerService = customerService;
     this._shoppingCartSettings = shoppingCartSettings;
     this._eventPublisher = eventPublisher;
     this._permissionService = permissionService;
     this._aclService = aclService;
 }
Exemple #9
0
        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());
        }
Exemple #10
0
        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;
        }
 /// <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;
 }
Exemple #12
0
        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());
        }
 /// <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;
 }
 //private readonly ILifetimeScope container;
 public GenericCharacteristicService()
 {
     //this.container = AutofacHostFactory.Container;
     this.genericCharacteristicRepository =
         EngineContext.Current.Resolve<IRepository<GenericCharacteristic>>();
     this.cacheManager = EngineContext.Current.Resolve<ICacheManager>();
 }
Exemple #15
0
 public void Init(string email, IRepository repository)
 {
     if (!string.IsNullOrEmpty(email))
     {
         User = repository.GetUser(email);
     }
 }
Exemple #16
0
        public ListsModule(IRepository db)
            : base("/pages/{pageid:guid}/lists")
        {
            this.RequiresAuthentication();

            Post("/", args => {
                return db.CreateList(this.Bind<List>().SetDefaults<List>());
            });

            Get("/{id:guid}", args => {
                return db.ReadList(args.id);
            });

            Put("/{id:guid}", args => {
                return db.UpdateList(this.Bind<List>().SetDefaults<List>());
            });

            Delete("/{id:guid}", args => {
                return db.DeleteList(args.id);
            });

            Put("/updateorder", args => {
                var ordering = this.Bind<Ordering>();
                db.UpdateListDisplayOrder(ordering);
                return true;
            });
        }
 public SecureLdapAuthenticationProvider(IConfigSectionProvider configSectionProvider, ILocalEducationAgencyContextProvider localEducationAgencyContextProvider, IRepository<LocalEducationAgency> localEducationAgencyRepository, IRepository<LocalEducationAgencyAuthentication> localEducationAgencyAuthenticationRepository)
 {
     this.configSectionProvider = configSectionProvider;
     this.localEducationAgencyContextProvider = localEducationAgencyContextProvider;
     _localEducationAgencyRepository = localEducationAgencyRepository;
     _localEducationAgencyAuthenticationRepository = localEducationAgencyAuthenticationRepository;
 }
Exemple #18
0
        public CampaignController(
            ICampaignService campaignService,
            ITShirtCostService tshirtService,
            IProductService productService,
            IPromotionService promotionService,
            IRepository<CurrencyRecord> currencyRepository,
            IWorkContextAccessor wca,
            INotifier notifier,
            IOrchardServices services,
            ICookieCultureService cookieCultureService,
            ICountryService countryService)
        {
            _currencyRepository = currencyRepository;
            Services = services;
            _tshirtService = tshirtService;
            _productService = productService;
            _campaignService = campaignService;
            _promotionService = promotionService;
            _wca = wca;
            _notifier = notifier;
            Logger = NullLogger.Instance;

            _cookieCultureService = cookieCultureService;
            //var culture = _wca.GetContext().CurrentCulture.Trim();
            _cultureUsed = _wca.GetContext().CurrentCulture.Trim();
            //cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
            _countryService = countryService;
        }
        public ApplyMaximumsTask(IRepository<AUMaxBidJobControlRecord> maxbidjobcontrolRepo,
                                        IRepository<AUMaxBidRecord> maxbidRepo,
                                        IRepository<AULotLastBidChangeRecord> lotlastbidchangeRepo,

                                        ILogger logger, 
                                        IConsignorService consignorService, 
                                        ICustomerService customerService, 
                                        IQueuedEmailService queuedEmailService,
                                        IEmailAccountService emailAccountService,
                                        EmailAccountSettings emailAccountSettings,
                                        IAUCatalogService AUcatalogService,
                                        ILotService lotService)
        {
            //this._customerService = customerService;
            this._logger = logger;
            this._maxbidjobcontrolRepo = maxbidjobcontrolRepo;
            this._maxbidRepo = maxbidRepo;
            this._lotlastbidchangeRepo = lotlastbidchangeRepo;
            this._consignorService = consignorService;
            this._customerService = customerService;
            this._queuedEmailService = queuedEmailService;
            this._emailAccountService = emailAccountService;
            this._emailAccountSettings = emailAccountSettings;
            this._AUcatalogService = AUcatalogService;
            this._lotService = lotService;
        }
Exemple #20
0
 public void Init(IEnumerable<Type> dataMigrations) {
    
     var builder = new ContainerBuilder();
     _folders = new StubFolders();
     var contentDefinitionManager = new Mock<IContentDefinitionManager>().Object;
     
     builder.RegisterInstance(new ShellSettings { DataTablePrefix = "TEST_"});
     
     builder.RegisterType<SqlServerDataServicesProvider>().As<IDataServicesProvider>();
     builder.RegisterType<DataServicesProviderFactory>().As<IDataServicesProviderFactory>();
     builder.RegisterType<NullInterpreter>().As<IDataMigrationInterpreter>();
     builder.RegisterInstance(_folders).As<IExtensionFolders>();
     builder.RegisterInstance(contentDefinitionManager).As<IContentDefinitionManager>();
     builder.RegisterType<ExtensionManager>().As<IExtensionManager>();
     builder.RegisterType<DataMigrationManager>().As<IDataMigrationManager>();
     builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
     builder.RegisterType<StubCacheManager>().As<ICacheManager>();
     builder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
     builder.RegisterType<StubAsyncTokenProvider>().As<IAsyncTokenProvider>();
     _session = _sessionFactory.OpenSession();
     builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>().As<ITransactionManager>();
     foreach(var type in dataMigrations) {
         builder.RegisterType(type).As<IDataMigration>();
     }
     _container = builder.Build();
     _container.Resolve<IExtensionManager>();
     _dataMigrationManager = _container.Resolve<IDataMigrationManager>();
     _repository = _container.Resolve<IRepository<DataMigrationRecord>>();
     _transactionManager = _container.Resolve<ITransactionManager>();
     InitDb();
 }
        public TermsPartHandler(
            IContentDefinitionManager contentDefinitionManager,
            IRepository<TermsPartRecord> repository,
            ITaxonomyService taxonomyService,
            IContentManager contentManager,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager) {
            _contentDefinitionManager = contentDefinitionManager;
            _contentManager = contentManager;

            Filters.Add(StorageFilter.For(repository));
            OnPublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
            OnUnpublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
            OnRemoved<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));

            // Tells how to load the field terms on demand, when a content item it loaded or when it has been created
            OnInitialized<TermsPart>((context, part) => InitializerTermsLoader(part));
            OnLoading<TermsPart>((context, part) => InitializerTermsLoader(part));
            OnUpdating<TermsPart>((context, part) => InitializerTermsLoader(part));

            OnIndexing<TermsPart>(
                (context, part) => {

                    foreach (var term in part.Terms) {
                        var termContentItem = context.ContentManager.Get(term.TermRecord.Id);
                        context.DocumentIndex.Add(term.Field, termContentItem.As<TitlePart>().Title).Analyze();
                        context.DocumentIndex.Add(term.Field + "-id", termContentItem.Id).Store();
                        // tag the current content item with all parent terms
                        foreach (var parent in taxonomyService.GetParents(termContentItem.As<TermPart>())) {
                            context.DocumentIndex.Add(term.Field + "-id", parent.Id).Store();
                        }
                    }
                });
        }
 /// <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;
 }
 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;
 }
Exemple #24
0
 public Creator(IUnitOfWork unitOfWork, IRepository<Battle> repositoryOfBattle, IRepository<User> repositoryOfUser, IRepository<Team> repositoryOfTeam)
 {
     _unitOfWork = unitOfWork;
     _repositoryOfBattle = repositoryOfBattle;
     _repositoryOfUser = repositoryOfUser;
     _repositoryOfTeam = repositoryOfTeam;
 }
        public CompilationsService(IRepositoryFactory repositoryFactory)
        {
            if(repositoryFactory == null)
                throw new ArgumentNullException(nameof(repositoryFactory));

            _compilationRepository = repositoryFactory.CreateCompilationRepository();
        }
 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);
 }
 public DefaultPageService(IRepository repository, IRedirectService redirectService, IUrlService urlService)
 {
     this.repository = repository;
     this.redirectService = redirectService;
     this.urlService = urlService;
     temporaryPageCache = new Dictionary<string, IPage>();
 }
 public PackageDataAggregateUpdater(IRepository<PackageDataAggregate> packageDataAggregateRepository,
     IRepository<PublishedPackage> publishedPackageRepository, IRepository<Package> packageRepository)
 {
     _packageDataAggregateRepository = packageDataAggregateRepository;
     _packageRepository = packageRepository;
     _publishedPackageRepository = publishedPackageRepository;
 }
 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;
 }
        public void SetUp()
        {
            _mockRepository = new MockRepository();
            _tagRepository = _mockRepository.DynamicMock<IRepository<Tag>>();

            _tagService = new TagService(_tagRepository);
        }
Exemple #31
0
 public static async Task TransactionWrapAsync(this IRepository repository, IsolationLevel isolationLevel, Func <Task> handler)
 {
     await repository.Transaction.TransactionWrapAsync(isolationLevel, handler);
 }
Exemple #32
0
 public RoleAppService(IRepository <Role> repository, RoleManager roleManager, UserManager userManager)
     : base(repository)
 {
     _roleManager = roleManager;
     _userManager = userManager;
 }
 private static void AssertStatus(bool shouldIgnoreCase, FileStatus expectedFileStatus, IRepository repo, string path)
 {
     try
     {
         Assert.Equal(expectedFileStatus, repo.RetrieveStatus(path));
     }
     catch (ArgumentException)
     {
         Assert.False(shouldIgnoreCase);
     }
 }
Exemple #34
0
 public MenuService(IRepository <Menu, int> menuRepository,
                    IUnitOfWork unitOfWork)
 {
     _menuRepository = menuRepository;
     _unitOfWork     = unitOfWork;
 }
Exemple #35
0
 public TagController(IRepository <Tag> tagRepo)
 {
     this.TagRepo = tagRepo;
 }
Exemple #36
0
        public StudentsRepository(IRepository<Students, string> repository)
            : base(repository)
        {

        }
 public StudentService(IRepository <StudentInfo> studentRepository)
 {
     _studentRepository = studentRepository;
 }
Exemple #38
0
 public static void TransactionWrap(this IRepository repository, IsolationLevel isolationLevel, Action handler)
 {
     repository.Transaction.TransactionWrap(isolationLevel, handler);
 }
Exemple #39
0
 public static async Task SessionWrapAsync(this IRepository repository, RequestContext context, Func <Task> handler)
 {
     await repository.Session.SessionWrapAsync(context, handler);
 }
Exemple #40
0
 public static async Task TransactionWrapAsync(this IRepository repository, Func <Task> handler)
 {
     await repository.Transaction.TransactionWrapAsync(handler);
 }
Exemple #41
0
 public static void SessionWrap(this IRepository repository, RequestContext context, Action handler)
 {
     repository.Session.SessionWrap(context, handler);
 }
Exemple #42
0
 public static void TransactionWrap(this IRepository repository, Action handler)
 {
     repository.Transaction.TransactionWrap(handler);
 }
Exemple #43
0
 public RegionStateService(IRepository <RegionState> regionStateRepo, IMapper mapper)
 {
     this.regionStateRepo = regionStateRepo;
     _mapper = mapper;
 }
Exemple #44
0
 public static async Task SessionWrapAsync(this IRepository repository, Func <Task> handler)
 {
     await repository.Session.SessionWrapAsync(handler);
 }
 public HRApprovalHistoryRepository(IRepository <HRApprovalHistory> repository, IUserResolverService UserResolverService) : base(repository, UserResolverService)
 {
 }
Exemple #46
0
 public static void SessionWrap(this IRepository repository, Action handler)
 {
     repository.Session.SessionWrap(handler);
 }
Exemple #47
0
 public UserService(IRepository <User> repository) : base(repository)
 {
     _repository = repository;
 }
///
        public ProfessorController(IRepository repo, IMapper mapper)
        {
            _mapper = mapper;
            _repo   = repo;
        }
Exemple #49
0
 public ReservationController(IRepository repo) => repository = repo;
 public EnterpriseSiteAppService(IRepository<EnterpriseSite, Guid> repository) : base(repository)
 {
     LocalizationResource = typeof(SolutionResource);
 }
 public Spartan_SettingsService(IDataProvider dataProvider, IDbContext dbContext, IRepository <Spartane.Core.Domain.Spartan_Settings.Spartan_Settings> Spartan_SettingsRepository)
 {
     this._dataProvider = dataProvider;
     this._dbContext    = dbContext;
     this._Spartan_SettingsRepository = Spartan_SettingsRepository;
 }
Exemple #52
0
 public TopicManagementController(IRepository <Topic> topicRepo)
 {
     _topicRepo = topicRepo;
 }
Exemple #53
0
 public AppService(IRepository <T> repository)
 {
     Repository = repository;
 }
Exemple #54
0
 public UserAppService(IRepository <User, long> userRepository, IPermissionManager permissionManager)
 {
     _userRepository    = userRepository;
     _permissionManager = permissionManager;
 }
Exemple #55
0
 public Open()
 {
     repos = new Repository();
 }
Exemple #56
0
 public InquiryService(IRepository <Data.Models.Inquiry> inquiryRepository)
 {
     this._inquiryRepository = inquiryRepository;
 }
Exemple #57
0
 public ItemService(IRepository repository, DbContextFakeCms dbContext)
 {
     _repository = repository;
     _dbContext  = dbContext;
 }
Exemple #58
0
   public Open(IRepository _repo)
 {
     repos = _repo;
 }
 public PostController(IRepository <Post> postRepository, IRepository <User> userRepository)
 {
     _postRepository = postRepository;
     _userRepository = userRepository;
 }
Exemple #60
0
 public TournamentServices(IRepository <KadabraTournament> repository)
 {
     this.repository = repository;
 }