refactor: clean code
This commit is contained in:
parent
dead9f89bb
commit
d8dbf1562f
@ -9,7 +9,6 @@ using Mirea.Api.Endpoint.Sync;
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using IServiceProvider = System.IServiceProvider;
|
|
||||||
|
|
||||||
namespace Mirea.Api.Endpoint.Configuration.Core.BackgroundTasks;
|
namespace Mirea.Api.Endpoint.Configuration.Core.BackgroundTasks;
|
||||||
|
|
||||||
|
@ -161,13 +161,13 @@ public class SetupController(
|
|||||||
}
|
}
|
||||||
else if (Directory.GetDirectories(path).Length != 0 ||
|
else if (Directory.GetDirectories(path).Length != 0 ||
|
||||||
!Directory.GetFiles(path).Select(x => string.Equals(Path.GetFileName(x), "database.db3")).All(x => x))
|
!Directory.GetFiles(path).Select(x => string.Equals(Path.GetFileName(x), "database.db3")).All(x => x))
|
||||||
|
{
|
||||||
throw new ControllerArgumentException("Such a folder exists. Enter a different name");
|
throw new ControllerArgumentException("Such a folder exists. Enter a different name");
|
||||||
|
}
|
||||||
|
|
||||||
var filePath = Path.Combine(path, "database.db3");
|
var filePath = Path.Combine(path, "database.db3");
|
||||||
var connectionString = $"Data Source={filePath}";
|
var connectionString = $"Data Source={filePath}";
|
||||||
|
|
||||||
//System.IO.File.Create(filePath);
|
|
||||||
|
|
||||||
var result = SetDatabase<SqliteConnection, SqliteException>(connectionString, DbSettings.DatabaseEnum.Sqlite);
|
var result = SetDatabase<SqliteConnection, SqliteException>(connectionString, DbSettings.DatabaseEnum.Sqlite);
|
||||||
|
|
||||||
foreach (var file in Directory.GetFiles(path))
|
foreach (var file in Directory.GetFiles(path))
|
||||||
|
Loading…
Reference in New Issue
Block a user