在一次dapper查询中为了不返回多余的字段,也为了方便创建自定义类,使用了元组Tuple<guid,sytring>,查询如下
/// <summary>/// 获取企业集合/// </summary>/// <param name="userId"></param>/// <returns></returns>public async Task<List<Tuple<Guid, string>>> GetAllDemandCompanyAsync(List<Guid> userIds){var sql = @"select UserId,CompanyName from base_companyInfo where `UserId` in @userIds ";var queryParams = new DynamicParameters();queryParams.Add(nameof(userIds), userIds);var connection = await GetDbConnectionAsync();var dbTransaction = await GetDbTransactionAsync();return (await connection.QueryAsync<Tuple<Guid, string>>(sql, queryParams, dbTransaction)).ToList();}
在前段时间调接口查询都木有问题,但是有一天突然