Skip to content

Commit

Permalink
project
Browse files Browse the repository at this point in the history
  • Loading branch information
KSemenenko committed Jun 3, 2024
1 parent 29e7b06 commit 8e8b3db
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions ManagedCode.Storage.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedCode.Storage.Google"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.FileSystem", "Storages\ManagedCode.Storage.FileSystem\ManagedCode.Storage.FileSystem.csproj", "{EDFA1CB7-1721-4447-9C25-AE110821717C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Server", "ManagedCode.Storage.Server\ManagedCode.Storage.Server.csproj", "{852B0DBD-37F0-4DC0-B966-C284AE03C2F5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Server", "Integraions\ManagedCode.Storage.Server\ManagedCode.Storage.Server.csproj", "{852B0DBD-37F0-4DC0-B966-C284AE03C2F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Azure.DataLake", "Storages\ManagedCode.Storage.Azure.DataLake\ManagedCode.Storage.Azure.DataLake.csproj", "{4D4D2AC7-923D-4219-9BC9-341FBA7FE690}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.TestFakes", "ManagedCode.Storage.TestFakes\ManagedCode.Storage.TestFakes.csproj", "{7190B548-4BE9-4EF6-B55F-8432757AEAD5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storages", "Storages", "{92201402-E361-440F-95DB-68663D228C2D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNet", "AspNet", "{94DB7354-F5C7-4347-B9EC-FCCA38B86876}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integraions", "Integraions", "{94DB7354-F5C7-4347-B9EC-FCCA38B86876}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Client", "ManagedCode.Storage.Client\ManagedCode.Storage.Client.csproj", "{D5A7D3A7-E6E8-4153-911D-D7C0C5C8B19C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Client", "Integraions\ManagedCode.Storage.Client\ManagedCode.Storage.Client.csproj", "{D5A7D3A7-E6E8-4153-911D-D7C0C5C8B19C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Client.SignalR", "ManagedCode.Storage.Client.SignalR\ManagedCode.Storage.Client.SignalR.csproj", "{ED216AAD-CBA2-40F2-AA01-63C60E906632}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCode.Storage.Client.SignalR", "Integraions\ManagedCode.Storage.Client.SignalR\ManagedCode.Storage.Client.SignalR.csproj", "{ED216AAD-CBA2-40F2-AA01-63C60E906632}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E609A83E-6400-42B0-AD5A-5B006EABC275}"
EndProject
Expand Down
27 changes: 0 additions & 27 deletions Samples/WebApiSample.Tests/WebApiSample.Tests.csproj

This file was deleted.

39 changes: 16 additions & 23 deletions Storages/ManagedCode.Storage.Azure/AzureStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@

namespace ManagedCode.Storage.Azure;

public class AzureStorage : BaseStorage<BlobContainerClient, IAzureStorageOptions>, IAzureStorage
public class AzureStorage(IAzureStorageOptions options, ILogger<AzureStorage>? logger = default)
: BaseStorage<BlobContainerClient, IAzureStorageOptions>(options), IAzureStorage
{
private readonly ILogger<AzureStorage>? _logger;

public AzureStorage(IAzureStorageOptions options, ILogger<AzureStorage>? logger = null) : base(options)
{
_logger = logger;
}

public override async Task<Result> RemoveContainerAsync(CancellationToken cancellationToken = default)
{
try
Expand All @@ -38,7 +32,7 @@ public override async Task<Result> RemoveContainerAsync(CancellationToken cancel
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result.Fail(ex);
}
}
Expand Down Expand Up @@ -83,7 +77,7 @@ await foreach (var item in StorageClient.GetBlobsAsync(prefix: directory, cancel
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<Stream>.Fail(ex);
}
}
Expand All @@ -100,7 +94,7 @@ await foreach (var item in StorageClient.GetBlobsAsync(prefix: directory, cancel
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<Stream>.Fail(ex);
}
}
Expand All @@ -126,8 +120,7 @@ protected override BlobContainerClient CreateStorageClient()
),

AzureStorageCredentialsOptions azureStorageCredentialsOptions => new BlobContainerClient(
new Uri(
$"https://{azureStorageCredentialsOptions.AccountName}.blob.core.windows.net/{azureStorageCredentialsOptions.ContainerName}"),
new Uri($"https://{azureStorageCredentialsOptions.AccountName}.blob.core.windows.net/{azureStorageCredentialsOptions.ContainerName}"),
azureStorageCredentialsOptions.Credentials,
azureStorageCredentialsOptions.OriginalOptions
),
Expand Down Expand Up @@ -156,7 +149,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
catch (Exception ex)
{
IsContainerCreated = false;
_logger.LogException(ex);
logger.LogException(ex);
return Result.Fail(ex);
}
}
Expand All @@ -178,7 +171,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result.Fail(ex);
}
}
Expand Down Expand Up @@ -207,7 +200,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<BlobMetadata>.Fail(ex);
}
}
Expand Down Expand Up @@ -241,7 +234,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<LocalFile>.Fail(ex);
}
}
Expand All @@ -263,7 +256,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<bool>.Fail(ex);
}
}
Expand All @@ -280,7 +273,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<bool>.Fail(ex);
}
}
Expand Down Expand Up @@ -314,7 +307,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<BlobMetadata>.Fail(ex);
}
}
Expand All @@ -333,7 +326,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result.Fail(ex);
}
}
Expand All @@ -350,7 +343,7 @@ protected override async Task<Result> CreateContainerInternalAsync(CancellationT
}
catch (Exception ex)
{
_logger.LogException(ex);
logger.LogException(ex);
return Result<bool>.Fail(ex);
}
}
Expand All @@ -377,7 +370,7 @@ public async Task<Result> SetStorageOptions(IStorageOptions options, Cancellatio
return await CreateContainerAsync(cancellationToken);
}

public async override Task<Result<Stream>> GetStreamAsync(string fileName, CancellationToken cancellationToken = default)
public override async Task<Result<Stream>> GetStreamAsync(string fileName, CancellationToken cancellationToken = default)
{
return await OpenReadStreamAsync(fileName, cancellationToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ManagedCode.Storage.Client.SignalR\ManagedCode.Storage.Client.SignalR.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.Client\ManagedCode.Storage.Client.csproj" />
<ProjectReference Include="..\..\Integraions\ManagedCode.Storage.Client.SignalR\ManagedCode.Storage.Client.SignalR.csproj" />
<ProjectReference Include="..\..\Integraions\ManagedCode.Storage.Client\ManagedCode.Storage.Client.csproj" />
<ProjectReference Include="..\..\Integraions\ManagedCode.Storage.Server\ManagedCode.Storage.Server.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.Core\ManagedCode.Storage.Core.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.Server\ManagedCode.Storage.Server.csproj" />
<ProjectReference Include="..\..\ManagedCode.Storage.TestFakes\ManagedCode.Storage.TestFakes.csproj" />
<ProjectReference Include="..\..\Storages\ManagedCode.Storage.Azure\ManagedCode.Storage.Azure.csproj" />
</ItemGroup>



</Project>

0 comments on commit 8e8b3db

Please sign in to comment.