mirror of
https://github.com/jcreek/Creek.FileRepository.git
synced 2026-07-13 10:53:43 +00:00
feat(*): Set Factory to utilise IConfiguration objects as parameters
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
using FileRepository.Repositories;
|
using FileRepository.Repositories;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace FileRepository
|
namespace FileRepository
|
||||||
{
|
{
|
||||||
@@ -46,7 +45,7 @@ namespace FileRepository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repositoryType">The type of repository to initialise, based on the enum member.</param>
|
/// <param name="repositoryType">The type of repository to initialise, based on the enum member.</param>
|
||||||
/// <returns>Returns an initialised repository.</returns>
|
/// <returns>Returns an initialised repository.</returns>
|
||||||
public static IFileRepository GetFileRepository(RepositoryType repositoryType)
|
public static IFileRepository GetFileRepository(RepositoryType repositoryType, IConfiguration config)
|
||||||
{
|
{
|
||||||
switch (repositoryType)
|
switch (repositoryType)
|
||||||
{
|
{
|
||||||
@@ -60,7 +59,7 @@ namespace FileRepository
|
|||||||
// break;
|
// break;
|
||||||
|
|
||||||
case RepositoryType.Sftp:
|
case RepositoryType.Sftp:
|
||||||
return new SftpRepository();
|
return new SftpRepository(config);
|
||||||
|
|
||||||
//case RepositoryType.Sql:
|
//case RepositoryType.Sql:
|
||||||
// break;
|
// break;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
|
||||||
<PackageReference Include="SSH.NET" Version="2020.0.1" />
|
<PackageReference Include="SSH.NET" Version="2020.0.1" />
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|||||||
Reference in New Issue
Block a user