Exemple #1
0
        public static ISiloBuilder UseAppConfiguration(this ISiloBuilder siloHost, AppSiloBuilderContext context)
        {
            _defaultProviderType = context.SiloOptions.StorageProviderType ?? StorageProviderType.Memory;

            var appInfo = context.AppInfo;

            siloHost
            .AddMemoryGrainStorage(OrleansConstants.GrainMemoryStorage)
            .UseStorage(OrleansConstants.GrainPersistenceStorage, context.AppInfo)
            .UseStorage(OrleansConstants.PubSubStore, context.AppInfo)
            .Configure <ClusterOptions>(options =>
            {
                options.ClusterId = appInfo.ClusterId;
                options.ServiceId = appInfo.Name;
            });

            if (context.HostBuilderContext.HostingEnvironment.IsDevelopment())
            {
                siloHost.UseDevelopment(context);
            }
            if (appInfo.IsDockerized)
            {
                siloHost.UseDockerSwarm(context);
            }
            else
            {
                siloHost.UseDevelopmentClustering(context);
            }

            return(siloHost);
        }
Exemple #2
0
 // Builder uses a complex series of steps
 public Processor Construct(StorageProviderType storageProviderType)
 {
     switch(storageProviderType)
     {
         case StorageProviderType.FileSystem:
             Construct(new FileSystemImageHandler());
             break;
     }
     return this;
 }
        protected IConfiguration GetConfiguration(StorageProviderType storageProviderType, IConfigurationProvider configProvider)
        {
            switch (storageProviderType)
            {
            case StorageProviderType.AzureBlob:
                return(new AzureBlobStorageConfiguration(configProvider, configurationForEntityType));

            case StorageProviderType.AzureFile:
                return(new AzureFileStorageConfiguration(configProvider, configurationForEntityType));
            }
            return(null);
        }
        protected StorageProviderType GetStorageProviderType(string storageProviderValue)
        {
            StorageProviderType providerType = StorageProviderType.CrmDefault;

            try
            {
                providerType = (StorageProviderType)Enum.Parse(typeof(StorageProviderType), storageProviderValue);
            }
            catch
            {
            }
            return(providerType);
        }
Exemple #5
0
        public static ISiloBuilder UseAppConfiguration(this ISiloBuilder siloHost, AppSiloBuilderContext context)
        {
            _defaultProviderType = context.SiloOptions.StorageProviderType ?? StorageProviderType.Memory;

            var appInfo = context.AppInfo;

            siloHost
            .AddMemoryGrainStorageAsDefault()
            .Configure <ClusterOptions>(options =>
            {
                options.ClusterId = appInfo.ClusterId;
                options.ServiceId = appInfo.Name;
            });

            siloHost.UseDevelopment(context);
            siloHost.UseDevelopmentClustering(context);

            return(siloHost);
        }
 // Constructor
 protected ImageHandler(StorageProviderType storageProvider)
 {
     ImageContainer = new ImageContainer(storageProvider);
 }
 // TODO: // Need to have in here, enough information to construct an URL, or even store the URL,
 // TODO: // Need to have enough inforation here so that this library can find the images.. to delete, move them to an alternate provider, etc.
 // TODO: // No matter which provider we are using.
 // Constructor
 public ImageContainer(StorageProviderType storageProvider)
 {
     _storageProvider = storageProvider;
 }
Exemple #8
0
 public ConnectionDTO(string connectionString, StorageProviderType storageProviderType)
 {
     ConnectionString    = connectionString;
     StorageProviderType = storageProviderType;
 }