refactor: clean code

This commit is contained in:
Polianin Nikita 2024-10-27 06:51:05 +03:00
parent dead9f89bb
commit d8dbf1562f
2 changed files with 2 additions and 3 deletions

View File

@ -9,7 +9,6 @@ using Mirea.Api.Endpoint.Sync;
using System;
using System.Threading;
using System.Threading.Tasks;
using IServiceProvider = System.IServiceProvider;
namespace Mirea.Api.Endpoint.Configuration.Core.BackgroundTasks;

View File

@ -161,13 +161,13 @@ public class SetupController(
}
else if (Directory.GetDirectories(path).Length != 0 ||
!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");
}
var filePath = Path.Combine(path, "database.db3");
var connectionString = $"Data Source={filePath}";
//System.IO.File.Create(filePath);
var result = SetDatabase<SqliteConnection, SqliteException>(connectionString, DbSettings.DatabaseEnum.Sqlite);
foreach (var file in Directory.GetFiles(path))