Beispiel #1
0
 public NodeTestFixture(ITestOutputHelper output, IDomainConfiguration domainConfiguration) : this(output, new[] { domainConfiguration })
 {
 }
 ///-------------------------------------------------------------------------------------------------
 /// <summary>
 ///  Constructor.
 /// </summary>
 /// <param name="store">
 ///  The store.
 /// </param>
 /// <param name="definition">
 ///  The definition.
 /// </param>
 ///-------------------------------------------------------------------------------------------------
 internal DomainBuilder(IDomainManager store, IDomainConfiguration definition)
 {
     _store      = store;
     _definition = definition;
 }
        ///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Prepare a new domain builder.
        /// </summary>
        /// <param name="models">
        ///  The models to act on.
        /// </param>
        /// <param name="definition">
        ///  (Optional) the definition.
        /// </param>
        /// <returns>
        ///  A DomainBuilder.
        /// </returns>
        ///-------------------------------------------------------------------------------------------------
        public static DomainBuilder New(this IModelList <IDomainModel> models, IDomainConfiguration definition = null)
        {
            var store = models.Store as IDomainManager;

            return(new DomainBuilder(store, definition ?? new DomainConfiguration()));
        }
 internal DomainConfiguration(IDomainConfiguration config = null)
 {
     _shared    = config;
     _factories = new List <Action <IServicesContainer> >();
 }
 Task <IDomainScope> IDomainModel.CreateScopeAsync(string scopeName, IDomainConfiguration configuration)
 {
     throw new NotImplementedException();
 }
        ///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Loads an extension.
        /// </summary>
        /// <exception cref="Exception">
        ///  Thrown when an exception error condition occurs.
        /// </exception>
        /// <param name="extensionName">
        ///  The name of the extension.
        /// </param>
        /// <param name="configuration">
        ///  (Optional) the configuration.
        /// </param>
        /// <returns>
        ///  The extension.
        /// </returns>
        ///-------------------------------------------------------------------------------------------------
        public virtual async Task <IDomainScope> CreateScopeAsync(string extensionName, IDomainConfiguration configuration = null)
        {
            Contract.RequiresNotEmpty(extensionName, "extensionName");
            CheckInitialized();

            if (this is ISchema)
            {
                throw new HyperstoreException("Can not create a scope for a schema. Uses LoadSchemaExtension for a schema");
            }

            Conventions.CheckValidDomainName(extensionName);
            if ((Store.Options & StoreOptions.EnableScopings) != StoreOptions.EnableScopings)
            {
                throw new HyperstoreException("Scoping are not enabled. Use EnableScoping when instancing the store.");
            }

            var services = Services.NewScope();

            // Removed graphadapter from services
            services.Register <IGraphAdapter>(null);

            var domain = await((IDomainManager)Store).CreateDomainModelAsync(extensionName, configuration, services,
                                                                             (r, name) => new Scopes.DomainScope(r, ((IDomainModel)this).Name, extensionName, this)
                                                                             );

            return((IDomainScope)domain);
        }
 public override System.Threading.Tasks.Task <IDomainScope> CreateScopeAsync(string extensionName, IDomainConfiguration configuration = null)
 {
     throw new NotImplementedException();
 }
Beispiel #8
0
 Task <IDomainScope> IDomainModel.CreateScopeAsync(string extensionName, IDomainConfiguration config)
 {
     throw new NotSupportedException();
 }