コード例 #1
0
        public static IBlobProvider Get <TContainer>(
            [NotNull] this IBlobProviderSelector selector)
        {
            Check.NotNull(selector, nameof(selector));

            return(selector.Get(BlobContainerNameAttribute.GetContainerName <TContainer>()));
        }
コード例 #2
0
 public BlobContainerConfigurations Configure <TContainer>(
     Action <BlobContainerConfiguration> configureAction)
 {
     return(Configure(
                BlobContainerNameAttribute.GetContainerName <TContainer>(),
                configureAction
                ));
 }
コード例 #3
0
 public BlobContainerConfigurations()
 {
     _containers = new Dictionary <string, BlobContainerConfiguration>
     {
         //Add default container
         [BlobContainerNameAttribute.GetContainerName <DefaultContainer>()] = new BlobContainerConfiguration()
     };
 }
コード例 #4
0
 /// <summary>
 /// Gets a named container.
 /// </summary>
 /// <param name="blobContainerFactory">The blob container manager</param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>
 /// The container object.
 /// </returns>
 public static IBlobContainer Create <TContainer>(
     this IBlobContainerFactory blobContainerFactory,
     CancellationToken cancellationToken = default
     )
 {
     return(blobContainerFactory.Create(
                BlobContainerNameAttribute.GetContainerName <TContainer>(),
                cancellationToken
                ));
 }
コード例 #5
0
 public void Should_Get_Specified_Name()
 {
     BlobContainerNameAttribute
     .GetContainerName <TestContainer2>()
     .ShouldBe("Test2");
 }
コード例 #6
0
 public void Should_Get_Full_Class_Name_If_Not_Specified()
 {
     BlobContainerNameAttribute
     .GetContainerName <TestContainer1>()
     .ShouldBe(typeof(TestContainer1).FullName);
 }
コード例 #7
0
 public BlobContainerConfiguration GetConfiguration <TContainer>()
 {
     return(GetConfiguration(BlobContainerNameAttribute.GetContainerName <TContainer>()));
 }