Вы можете использовать проекцию с Linq Select
, это может быть немного более кратким
var dtos = query.Select(x => new BankDepositHistoryDTO()
{
AccountId = x.AccountId,
Id = x.Id,
Amount = x.Amount,
AdditionalData = x.AdditionalData,
ClientIp = x.ClientIp,
Gateway = x.Gateway,
PaymentRefNumber = x.PaymentRefNumber,
ReturnUrl = x.ReturnUrl,
State = x.State,
Uuid = x.Uuid
}).ToList();
или
List<BankDepositHistoryDTO> BankDepositHistoryDTOs = new List<BankDepositHistoryDTO>();
foreach(var item in query)
{
BankDepositHistoryDTO b = new BankDepositHistoryDTO();
b.AccountId = item.AccountId;
b.Id = item.Id;
b.Amount = item.Amount;
b.AdditionalData = item.AdditionalData;
b.ClientIp = item.ClientIp;
b.Gateway = item.Gateway;
b.PaymentRefNumber = item.PaymentRefNumber;
b.ReturnUrl = item.ReturnUrl;
b.State = item.State;
b.Uuid = item.Uuid;
BankDepositHistoryDTOs.Add(b);
}