Fix Azure Storage (#803)

This commit is contained in:
Andrew Camilleri 2019-05-02 13:39:13 +02:00 committed by Nicolas Dorier
parent bac99deb6c
commit 8a99fc0505
2 changed files with 13 additions and 3 deletions

View file

@ -1,9 +1,11 @@
using System.ComponentModel.DataAnnotations;
using BTCPayServer.Storage.Services.Providers.Models;
using Microsoft.AspNetCore.Mvc;
using TwentyTwenty.Storage.Azure;
namespace BTCPayServer.Storage.Services.Providers.AzureBlobStorage.Configuration
{
[ModelMetadataType(typeof(AzureBlobStorageConfigurationMetadata))]
public class AzureBlobStorageConfiguration : AzureProviderOptions, IBaseStorageConfiguration
{
[Required]
@ -12,8 +14,5 @@ namespace BTCPayServer.Storage.Services.Providers.AzureBlobStorage.Configuration
[RegularExpression(@"[a-z0-9-]+",
ErrorMessage = "Characters must be lowercase or digits or -")]
public string ContainerName { get; set; }
[Required][AzureBlobStorageConnectionStringValidator]
public new string ConnectionString { get; set; }
}
}

View file

@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace BTCPayServer.Storage.Services.Providers.AzureBlobStorage.Configuration
{
public class AzureBlobStorageConfigurationMetadata
{
[Required]
[AzureBlobStorageConnectionStringValidator]
public string ConnectionString { get; set; }
}
}