public DynamicProxyFactory(IMetadataFactory metadataFactory, ILogger logger) { _metadataFactory = metadataFactory; _logger = logger; _generator = new ProxyGenerator(); _options = new ProxyGenerationOptions(new ProxyGenerationHook()); }
/// <summary> /// /// </summary> /// <param name="config"></param> public StandardResolver(IResolverConfig config) { if (config == null) { throw new ArgumentNullException("config"); } bindingsFactory = CreateBindings; instanceFactory = CreateInstance; Components = config.CreateComponentContainer(); metadataFactory = Components.Get <IMetadataFactory>(); processors = Components.GetAll <IProcessor>().ToArray(); injectors = Components.GetAll <IInjector>().ToArray(); handlers = Components.GetAll <IMissingHandler>().ToArray(); foreach (var group in config.CreateBindings(Components).GroupBy(b => b.Type)) { table.Add(group.Key, group.ToArray()); } var selfType = typeof(IResolver); table.Add(selfType, new IBinding[] { new Binding(selfType, new ConstantProvider <IResolver>(this), null, null, null, null) }); }
public Models.SiteMetadata GetSitePolices([FromBody] string value) { SiteEditMetadata _metadata = new SiteEditMetadata(); var _request = JsonConvert.DeserializeObject <Models.SiteMetadata>(value); _request.Success = false; _metadata.TenantAdminUrl = _request.TenantAdminUrl; _metadata.Url = _request.Url; try { IMetadataFactory _factory = MetadataFactory.GetInstance(); IMetadataManager _manager = _factory.GetManager(); var _results = _manager.SetSitePolicy(_metadata); _request.Success = true; return(_request); } catch (Exception _ex) { _request.ErrorMessage = _ex.Message; OfficeDevPnP.Core.Diagnostics.Log.Error("MetadataController.GetSiteMetadata", "There was an error processing the request. Exception: {0}", _ex); return(_request); } }
/// <summary> /// Creates an instance of the <see cref="InMemoryEventStore"/> class. /// </summary> /// <param name="settings">Settings</param> public InMemoryEventStore(InMemoryEventStoreSettings settings) { _serializer = settings.EventSerializer; _streamNameResolver = settings.StreamNameResolver; _clock = settings.Clock; _metadataFactory = settings.MetadataFactory; }
public MetadataService(IConfigService configService, IDiskProvider diskProvider, IDiskTransferService diskTransferService, IRecycleBinProvider recycleBinProvider, IOtherExtraFileRenamer otherExtraFileRenamer, IMetadataFactory metadataFactory, ICleanMetadataService cleanMetadataService, IHttpClient httpClient, IMediaFileAttributeService mediaFileAttributeService, IMetadataFileService metadataFileService, IBookService bookService, Logger logger) : base(configService, diskProvider, diskTransferService, logger) { _metadataFactory = metadataFactory; _cleanMetadataService = cleanMetadataService; _otherExtraFileRenamer = otherExtraFileRenamer; _recycleBinProvider = recycleBinProvider; _diskTransferService = diskTransferService; _diskProvider = diskProvider; _httpClient = httpClient; _mediaFileAttributeService = mediaFileAttributeService; _metadataFileService = metadataFileService; _bookService = bookService; _logger = logger; }
public RepositoryFactory(ICypherTransactionFactory cypherTransactionFactory, IProxyFactory proxyFactory, IMetadataFactory metadataFactory) { _mappers = new ConcurrentDictionary <Type, Func <IGraphSession, IMapper> >(); _cypherTransactionFactory = cypherTransactionFactory; _proxyFactory = proxyFactory; _metadataFactory = metadataFactory; }
public void CanGetInstanceManager() { IMetadataFactory _factory = MetadataFactory.GetInstance(); IMetadataManager _manager = _factory.GetManager(); Assert.IsInstanceOfType(_manager, typeof(IMetadataManager)); Assert.IsNotNull(_manager); }
public void CanCreateNewSiteClassification() { IMetadataFactory _factory = MetadataFactory.GetInstance(); IMetadataManager _manager = _factory.GetManager(); var _siteClassificationMock = GetMock(); _manager.CreateNewSiteClassification(_siteClassificationMock); }
public BindableObjectProvider(IMetadataFactory metadataFactory, IBusinessObjectServiceFactory serviceFactory) : base(serviceFactory) { ArgumentUtility.CheckNotNull("metadataFactory", metadataFactory); ArgumentUtility.CheckNotNull("serviceFactory", serviceFactory); _metadataFactory = metadataFactory; }
public GetQueryExecutor(ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory, Func <IRecord, TResult> map, Func <ICypherReturn <TResult>, ICypherReturn <TResult> > returnFactory) : base(transactionFactory, metadataFactory) { _map = map; _returnFactory = returnFactory; }
public override void SetUp() { base.SetUp(); _provider = new BindableObjectProvider(); BindableObjectProvider.SetProvider(typeof(BindableObjectProviderAttribute), _provider); _metadataFactoryStub = MockRepository.GenerateStub <IMetadataFactory>(); _serviceFactoryStub = MockRepository.GenerateStub <IBusinessObjectServiceFactory>(); }
public StateSourcedRepository( IAggregateLoaderFactory aggregateLoaderFactory, IMessageStore messageStore, IMetadataFactory metadataFactory) { this.aggregateLoaderFactory = aggregateLoaderFactory; this.messageStore = messageStore; this.metadataFactory = metadataFactory; }
public void Instantiate_WithCustomValues() { IMetadataFactory metadataFactoryStub = MockRepository.GenerateStub <IMetadataFactory>(); IBusinessObjectServiceFactory serviceFactoryStub = MockRepository.GenerateStub <IBusinessObjectServiceFactory>(); BindableDomainObjectProvider provider = new BindableDomainObjectProvider(metadataFactoryStub, serviceFactoryStub); Assert.That(provider.MetadataFactory, Is.SameAs(metadataFactoryStub)); Assert.That(provider.ServiceFactory, Is.SameAs(serviceFactoryStub)); }
internal ServiceForOracle(ILogger <ServiceForOracle> logger, IDbConnectionFactory factory, IMetadataBuilderFactory builderFactory, IOracleRefCursorWrapperFactory wrapperFactory, IMetadataFactory metadataFactory) { _Logger = logger; _DbFactory = factory ?? throw new ArgumentNullException(nameof(factory)); _MetadataFactory = metadataFactory ?? throw new ArgumentNullException(nameof(metadataFactory)); _Common = _MetadataFactory.CreateCommon(); _BuilderFactory = builderFactory ?? throw new ArgumentNullException(nameof(builderFactory)); _RefCursorWrapperFactory = wrapperFactory ?? throw new ArgumentNullException(nameof(wrapperFactory)); }
public Generator(IGraphSession session, IMetadataFactory metadataFactory, ProxyGenerator generator, ProxyGenerationOptions options, EntityStatus status = EntityStatus.Clean) { _generator = generator; _session = session; _metadataFactory = metadataFactory; _state = session.State; _status = status; _dependencyStack = new Stack <EntityReference>(); _options = options; }
public static ResolverConfig UseMetadataFactory(this ResolverConfig config, IMetadataFactory metadataFactory) { if (config == null) { throw new ArgumentNullException("config"); } config.Components.Add(typeof(IMetadataFactory), metadataFactory); return(config); }
public void CanGetSiteClassificationByName() { IMetadataFactory _factory = MetadataFactory.GetInstance(); IMetadataManager _manager = _factory.GetManager(); var _expectedMock = GetMock(); var _actualMock = _manager.GetSiteClassificationByName(_expectedMock.Key); Assert.AreEqual(_expectedMock.Key, _actualMock.Key); }
/// <summary> /// Initializes a new instance of the <see cref="MongoEventStore"/> class. /// </summary> /// <param name="settings">The settings to configure behaviour of the instance.</param> public MongoEventStore(MongoEventStoreSettings settings) { _database = settings.Database; _collection = settings.Collection; _events = settings.Database.GetCollection <RecordedEventDocument>(settings.Collection); _serializer = settings.EventSerializer; _logger = settings.Logger; _clock = settings.Clock; _transactionOptions = settings.TransactionOptions; _streamNameResolver = settings.StreamNameResolver; _metadataFactory = settings.MetadataFactory; }
/// <summary> /// Initializes a new instance of the <see cref="MetadataCollection" /> class. /// </summary> /// <param name="factory">The factory of the collection.</param> /// <exception cref="System.ArgumentNullException">The factory is null.</exception> /// <exception cref="System.ArgumentException">The specified factory is invalid.</exception> public MetadataCollection(IMetadataFactory factory) : base() { if (factory == null) { throw new ArgumentNullException("factory", "The factory is null."); } if (!(factory is MetadataFactory)) { throw new ArgumentException("The specified factory is invalid.", "factory"); } _factory = factory; }
public MetadataService(IMetadataFactory metadataFactory, IMetadataFileService metadataFileService, ICleanMetadataService cleanMetadataService, IMediaFileService mediaFileService, IEpisodeService episodeService, Logger logger) { _metadataFactory = metadataFactory; _metadataFileService = metadataFileService; _cleanMetadataService = cleanMetadataService; _mediaFileService = mediaFileService; _episodeService = episodeService; _logger = logger; }
public MetaDataLoader(IMetadataFactory metadataFactory, IMetadataMapper fileMetadataMapper) { if (metadataFactory == null) { throw new ArgumentNullException(nameof(metadataFactory)); } if (fileMetadataMapper == null) { throw new ArgumentNullException(nameof(fileMetadataMapper)); } m_MetadataFactory = metadataFactory; m_FileMetadataMapper = fileMetadataMapper; }
/// <summary> /// Initializes a new instance of the <see cref="MetadataCollection" /> class. /// </summary> /// <param name="source">The <see cref="IDictionary{String, Object}" /> whose elements are copied to the new <see cref="MetadataCollection" />.</param> /// <param name="factory">The factory of the collection.</param> /// <exception cref="System.ArgumentNullException">The factory is null.</exception> /// <exception cref="System.ArgumentException">The specified factory is invalid.</exception> public MetadataCollection(IDictionary <String, Object> source, IMetadataFactory factory) : base(source) { if (factory == null) { throw new ArgumentNullException("factory", "The factory is null."); } if (!(factory is MetadataFactory)) { throw new ArgumentException("The specified factory is invalid.", "factory"); } _factory = factory; }
public ClassReflector( Type targetType, BindableObjectProvider businessObjectProvider, IMetadataFactory metadataFactory, BindableObjectGlobalizationService bindableObjectGlobalizationService) { ArgumentUtility.CheckNotNull("targetType", targetType); ArgumentUtility.CheckNotNull("businessObjectProvider", businessObjectProvider); ArgumentUtility.CheckNotNull("metadataFactory", metadataFactory); ArgumentUtility.CheckNotNull("bindableObjectGlobalizationService", bindableObjectGlobalizationService); _targetType = targetType; _concreteType = BindableObjectProvider.GetConcreteTypeForBindableObjectImplementation(_targetType); _businessObjectProvider = businessObjectProvider; _metadataFactory = metadataFactory; _bindableObjectGlobalizationService = bindableObjectGlobalizationService; }
public HttpResponseMessage GetSitePolices() { try { IMetadataFactory _factory = MetadataFactory.GetInstance(); IMetadataManager _manager = _factory.GetManager(); var _siteClassifications = _manager.GetAvailableSiteClassifications(); return(Request.CreateResponse(HttpStatusCode.OK, _siteClassifications)); } catch (Exception _ex) { var _message = string.Format("There was an error processing the request. {0}", _ex.Message); Log.Error("MetadataController.GetSitePolices", "There was an error processing the request. Exception: {0}", _ex); HttpResponseMessage _response = Request.CreateResponse(HttpStatusCode.InternalServerError, _message); throw new HttpResponseException(_response); } }
public void FactoryRegistryMethodsTest() { Assert.IsTrue(FactoryRegistry.AutoLocation); FactoryRegistry.AutoLocation = false; Assert.IsFalse(FactoryRegistry.AutoLocation); FactoryRegistry.AutoLocation = true; Assert.IsTrue(FactoryRegistry.AutoLocation); // default query IMetadataFactory metadataFactory = FactoryRegistry.GetFactory <IMetadataFactory>(); Assert.IsNotNull(metadataFactory); Assert.IsInstanceOf <MetadataFactory>(metadataFactory); IGeometryFactory geometryFactory = FactoryRegistry.GetFactory <IGeometryFactory>(); Assert.IsNotNull(geometryFactory); Assert.IsInstanceOf <GeometryFactory>(geometryFactory); geometryFactory = FactoryRegistry.GetFactoryFor <IGeometry>() as IGeometryFactory; Assert.IsNotNull(geometryFactory); Assert.IsInstanceOf <GeometryFactory>(geometryFactory); // parameterized query geometryFactory = FactoryRegistry.GetFactory <IGeometryFactory>(PrecisionModel.Default, _referenceSystemMock.Object); Assert.IsNotNull(geometryFactory); Assert.IsInstanceOf <GeometryFactory>(geometryFactory); Assert.AreEqual(PrecisionModel.Default, geometryFactory.PrecisionModel); Assert.AreEqual(_referenceSystemMock.Object, geometryFactory.ReferenceSystem); geometryFactory = FactoryRegistry.GetFactoryFor <IGeometry>(PrecisionModel.Default, _referenceSystemMock.Object) as IGeometryFactory; Assert.IsNotNull(geometryFactory); Assert.IsInstanceOf <GeometryFactory>(geometryFactory); Assert.AreEqual(PrecisionModel.Default, geometryFactory.PrecisionModel); Assert.AreEqual(_referenceSystemMock.Object, geometryFactory.ReferenceSystem); // exceptions Assert.Throws <ArgumentNullException>(() => FactoryRegistry.GetFactory(null)); }
public MetadataService(IMetadataFactory metadataFactory, IMetadataFileService metadataFileService, ICleanMetadataService cleanMetadataService, IMediaFileService mediaFileService, IEpisodeService episodeService, IDiskProvider diskProvider, IHttpProvider httpProvider, IEventAggregator eventAggregator, Logger logger) { _metadataFactory = metadataFactory; _metadataFileService = metadataFileService; _cleanMetadataService = cleanMetadataService; _mediaFileService = mediaFileService; _episodeService = episodeService; _diskProvider = diskProvider; _httpProvider = httpProvider; _eventAggregator = eventAggregator; _logger = logger; }
public MetadataService(IConfigService configService, IDiskProvider diskProvider, IDiskTransferService diskTransferService, IMetadataFactory metadataFactory, ICleanMetadataService cleanMetadataService, IHttpClient httpClient, IMediaFileAttributeService mediaFileAttributeService, IMetadataFileService metadataFileService, Logger logger) : base(configService, diskProvider, diskTransferService, logger) { _metadataFactory = metadataFactory; _cleanMetadataService = cleanMetadataService; _diskTransferService = diskTransferService; _diskProvider = diskProvider; _httpClient = httpClient; _mediaFileAttributeService = mediaFileAttributeService; _metadataFileService = metadataFileService; _logger = logger; }
public Models.SiteMetadata SetSiteMetadata([FromBody] string value) { ConfigManager _cfgmanager = new ConfigManager(); var _auth = new AppOnlyAuthenticationTenant(); _auth.TenantAdminUrl = _cfgmanager.GetAppSettingsKey("TenantAdminUrl"); var _request = JsonConvert.DeserializeObject <Models.SiteMetadata>(value); _request.TenantAdminUrl = _auth.TenantAdminUrl; // Transform the request var _metadataRequest = ObjectMapper.ToSiteEditMetadata(_request); _metadataRequest.Success = false; try { IMetadataFactory _factory = MetadataFactory.GetInstance(); IMetadataManager _manager = _factory.GetManager(); var _metadataResponse = _manager.SetSiteMetadata(_metadataRequest); _metadataResponse.Success = true; // Transform response var _response = ObjectMapper.ToSiteMetadata(_metadataResponse); return(_response); } catch (Exception _ex) { _request.ErrorMessage = _ex.Message; OfficeDevPnP.Core.Diagnostics.Log.Error("MetadataController.SetSiteMetadata", "There was an error processing the request. Exception: {0}", _ex); return(_request); } }
public QueryExecutorFactory(ICypherTransactionFactory transactionFactory, IMetadataFactory metadataFactory, params Assembly[] assemblies) : this(metadataFactory) { foreach (var assembly in assemblies) { var types = assembly.GetTypes().Where(x => typeof(IQueryExecutor).IsAssignableFrom(x)); foreach (var type in types) { if (type.BaseType == null) { continue; } var arguments = type.BaseType.GetGenericArguments(); if (arguments.Length == 3) { var local = type; Register(session => (IQueryExecutor)Activator.CreateInstance(local, transactionFactory, _metadataFactory), arguments[2]); } } } }
public MetadataModule(IMetadataFactory metadataFactory) : base(metadataFactory, "metadata", ResourceMapper) { }
/// <summary> /// The initialize. /// </summary> /// <param name="components"> /// The components. /// </param> public override void Initialize(ComponentRegistry components) { _eventManager = components.Get<IEventManager>(); _factory = components.Get<IMetadataFactory>(); _interceptorFactories = components.GetAll<IImportInterceptorFactory>().ToArray(); }