mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Finally a nicer looking and working TextBoxWithButton (inspired from the SearchButton)
SearchBox field style improved
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Application.Group.Models;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Group.Queries.GetAllGroups
|
||||
{
|
||||
public class GetAllGroupsQuery : IRequest<IEnumerable<GroupVm>>
|
||||
{
|
||||
public string GroupId { get; set; }
|
||||
|
||||
public class GetAllGroupsQueryHandler : IRequestHandler<GetAllGroupsQuery, IEnumerable<GroupVm>>
|
||||
{
|
||||
private readonly IDatabaseProxy _database;
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public GetAllGroupsQueryHandler(IDatabaseProxy database, IMapper mapper)
|
||||
{
|
||||
_database = database;
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public IEnumerable<GroupVm> Handle(GetAllGroupsQuery message)
|
||||
{
|
||||
if (!_database.IsOpen) throw new DatabaseClosedException();
|
||||
return _database.GetAllGroups(message.GroupId).Select(g => _mapper.Map<GroupVm>(g));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user