Finally a nicer looking and working TextBoxWithButton (inspired from the SearchButton)

SearchBox field style improved
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-28 15:20:47 +02:00
parent 8e06bf4bb0
commit f158e5aced
24 changed files with 481 additions and 283 deletions

View File

@@ -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));
}
}
}
}