mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Correct package version installed
Dependency injection works Project renaming WIP replacement of services with CQRS
This commit is contained in:
@@ -7,6 +7,7 @@ namespace ModernKeePass.Application.Common.Interfaces
|
||||
public interface IDatabaseProxy
|
||||
{
|
||||
bool IsOpen { get; }
|
||||
string Name { get; }
|
||||
GroupEntity RecycleBin { get; set; }
|
||||
BaseEntity Cipher { get; set; }
|
||||
BaseEntity KeyDerivation { get; set; }
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{
|
||||
public interface ISettingsProxy
|
||||
{
|
||||
T GetSetting<T>(string property, T defaultValue = default);
|
||||
T GetSetting<T>(string property, T defaultValue = default(T));
|
||||
void PutSetting<T>(string property, T value);
|
||||
}
|
||||
}
|
@@ -9,20 +9,20 @@ namespace ModernKeePass.Application.Common.Mappings
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
ApplyMappingsFromAssembly(Assembly.GetExecutingAssembly());
|
||||
ApplyMappingsFromAssembly(typeof(MappingProfile).GetTypeInfo().Assembly);
|
||||
}
|
||||
|
||||
private void ApplyMappingsFromAssembly(Assembly assembly)
|
||||
{
|
||||
var types = assembly.GetExportedTypes()
|
||||
.Where(t => t.GetInterfaces().Any(i =>
|
||||
i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IMapFrom<>)))
|
||||
var types = assembly.ExportedTypes
|
||||
.Where(t => t.GetTypeInfo().ImplementedInterfaces.Any(i =>
|
||||
i.GetTypeInfo().IsGenericType && i.GetGenericTypeDefinition() == typeof(IMapFrom<>)))
|
||||
.ToList();
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
var instance = Activator.CreateInstance(type);
|
||||
var methodInfo = type.GetMethod("Mapping");
|
||||
var methodInfo = type.GetTypeInfo().GetDeclaredMethod("Mapping");
|
||||
methodInfo?.Invoke(instance, new object[] { this });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user