public async Task <IEnumerable <UserOutput> > Handle(GetUsersQuery request, CancellationToken cancellationToken)
 {
     return((await _dbQueryHelper.Query <UserRequest>($@"
                             SELECT u.id, u.firstName, u.lastName, u.email, r.name, r.id as code, r.permissions as permission, u.isActive
                             FROM [User] u
                             INNER JOIN [Role] r ON u.RoleId = r.Id"))
            .Select(user => new UserOutput(user.Id, user.LastName, user.FirstName, user.Email, user.IsActive,
                                           new RoleOutput(user.Name, user.Permission))));
 }
 public async Task <IEnumerable <RfaOutput> > Handle(GetAllRfasQuery request, CancellationToken cancellationToken)
 {
     return((await _dbQueryHelper.Query <RfaRequest>(@"
         select 
         rfa.PhoneNumber, rfa.Profession,
         [User].LastName, [User].FirstName, rfa.Email
         from RfaInfo rfa
         inner join [User] on [User].Id = rfa.UserId
         where [User].isActive = 1;
      ")).Select(rfa => new RfaOutput(rfa.PhoneNumber, rfa.Profession, new RfaUserOutput(rfa.LastName, rfa.FirstName, rfa.Email))));
 }
 public async Task <ApplicationInfoOutput> Handle(GetApplicationInfoQuery request, CancellationToken cancellationToken)
 {
     return((await _dbQueryHelper.Query <ApplicationInfoOutput>(@"
         select NameApp, VersionApp, CodeApp from ApplicationInfo;
      ")).Last());
 }