Removed half-baked import feature for now

No views depend on services anymore
Dirty status fully handled by behavior
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-27 11:14:29 +02:00
parent 59ab43ca9c
commit 8e06bf4bb0
11 changed files with 34 additions and 113 deletions

View File

@@ -7,14 +7,14 @@ using ModernKeePass.Application.Database.Commands.SaveDatabase;
namespace ModernKeePass.Application.Common.Behaviors
{
public class SetDirtyBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
public class DirtyStatusBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
{
private readonly List<string> _excludedCommands = new List<string>
{nameof(SaveDatabaseCommand), nameof(CloseDatabaseCommand)};
private readonly IDatabaseProxy _database;
public SetDirtyBehavior(IDatabaseProxy database)
public DirtyStatusBehavior(IDatabaseProxy database)
{
_database = database;
}
@@ -23,9 +23,9 @@ namespace ModernKeePass.Application.Common.Behaviors
{
var response = await next();
var queryName = typeof(TRequest).Name;
if (queryName.Contains("Command") && !_excludedCommands.Contains(queryName))
if (queryName.Contains("Command"))
{
_database.IsDirty = true;
_database.IsDirty = !_excludedCommands.Contains(queryName);
}
return response;