using System.Collections.Generic;
using System.Threading.Tasks;

namespace iRIS.KaskoLink2.Code.Interfaces.BankSettings
{
    public interface IBankSettingsQueryInvoker
    {
        Task<IEnumerable<iRIS.KaskoLink2.Entities.BankSettings>> GetBankSettingsAsync(string bik);

        Task<IEnumerable<BankSettingsDictionaryDto>> GetBankSettingsDictionaryAsync();
    }
}


using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Dapper;
using iRIS.KaskoLink2.Code.Interfaces.BankSettings;

namespace iRIS.KaskoLink2.Code.Implementations.BankSettings
{
    public class BankSettingsQueryInvoker : IBankSettingsQueryInvoker
    {
        private readonly string _connectionString;

        public BankSettingsQueryInvoker(string connectionString)
        {
            _connectionString = connectionString ?? throw new ArgumentNullException(nameof(_connectionString));
        }

        public async Task<IEnumerable<iRIS.KaskoLink2.Entities.BankSettings>> GetBankSettingsAsync(string bik)
        {
            var sqlQueryStr = @"SELECT * FROM BankSettings WITH (NOLOCK)
                    WHERE
                        Code = @bik"
            ;

            var command = new CommandDefinition(sqlQueryStr, new { bik });

            using var connection = new SqlConnection(_connectionString);
            connection.Open();

            var result = await connection.QueryAsync<iRIS.KaskoLink2.Entities.BankSettings>(command);

            return result;
        }

        public async Task<IEnumerable<BankSettingsDictionaryDto>> GetBankSettingsDictionaryAsync()
        {
            var sqlQueryStr = @"SELECT le.[Name]
                  ,bs.[Code] AS BIK
                  ,bs.[DivisionID]
                  ,bs.[Code]
                  ,bs.[InsPeriodMax]
                  ,bs.[Currency]
                  ,bs.[Avarkom1]
                  ,bs.[Avarkom2]
                  ,bs.[Avarkom3]
                  ,bs.[AvarkomSertificates]
                  ,bs.[Mirrors1]
                  ,bs.[Mirrors2]
                  ,bs.[Percent3]
                  ,bs.[Percent5]
                  ,bs.[Evacuation]
                  ,bs.[EmergencyRepair]
                  ,bs.[Taxi]
                  ,bs.[CarRental]
                  ,bs.[DmgEnabled]
                  ,bs.[HJEnabled]
                  ,bs.[TotalEnabled]
                  ,bs.[GoSum]
                  ,bs.[NSSum]
                  ,bs.[EqSum]
                  ,bs.[GAP]
                  ,bs.[FranType]
                  ,bs.[FranSum]
                  ,bs.[FranKeysDocsSumCoef]
                  ,bs.[FranKeysDocsCoef]
                  ,bs.[CurTimes2]
                  ,bs.[CurTimes4]
                  ,bs.[RepairStoaWithoutDealer]
                  ,bs.[RepairStoa]
                  ,bs.[RepairStoaInsurant]
                  ,bs.[RepairCalculation]
                  ,bs.[RepairThrottle]
                  ,bs.[MirrorsStoaNotChoice]
                  ,bs.[MirrorsOnStoa]
                  ,bs.[MirrorsStoaChoice]
                  ,bs.[BenDmg]
                  ,bs.[BenHJ]
                  ,bs.[BenTotal]
                  ,bs.[IsAgreementExists]
                  ,bs.[LastEditDate]
                  ,bs.[DriversAge]
                  ,bs.[DriversExp]
                  ,bs.[DriversUseType]
                  ,bs.[NoLimAgeExp]
                  ,bs.[BenAdditionalTermsStatus]
                  ,bs.[CurTimes2prolong]
                  ,bs.[CurTimes4prolong]
                  ,bs.[FranSum4Use]
                  ,bs.[FranSum4Coef]
                  ,bs.[FranDriversSumCoef]
                  ,bs.[FranDriversCoef]
                  ,bs.[UseBankNameInBen]
                  ,bs.[PpgIsEnabled]
                  ,bs.[RepairStoaNotChoice]
                  ,bs.[IsAdditionalOptionsRequired]
              FROM BankSettings bs WITH (NOLOCK)
	            JOIN Bank b WITH (NOLOCK) ON bs.BankID = b.Id
	            JOIN Subject s WITH (NOLOCK) ON b.Subject_Id = s.Id
	            JOIN LegalEntity le WITH (NOLOCK) ON s.LegalEntity_Id = le.Id";

            using var connection = new SqlConnection(_connectionString);
            connection.Open();

            var queryResult = await connection.QueryAsync<BankSettingsDictionaryDto>(sqlQueryStr);

            return queryResult;
        }
    }
}


Что делает этот код?