Does the First item of Tuple must be string? v5.8

We have string to int conversion issue…

    var cogQuery = Db.From<CogLoadDataModel.Cognos.Sale>()
        .Join<CogLoadDataModel.Cognos.Customer>((sale, cust) => sale.ShipToSID == cust.Id)
        .Join<CogLoadDataModel.Cognos.Product>((sale, prod) => sale.ProductSID == prod.Id)
        .Where(x => x.EntityCd == entityCd);
    try
    {
        //var test = Db.Select<(int? EntityCd, string OrderNum, int? InvoiceLineNum, int? OrderLineNum, string InvoiceNum, string ShipToCd, string ProductCd)>(cogQuery);
       var test2 = Db.Select<(string OrderNum, int? EntityCd, int? InvoiceLineNum, int? OrderLineNum, string InvoiceNum, string ShipToCd, string ProductCd)>(cogQuery);
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.Message);
    }

if we run the first Db.Select we get an error saying we can convert to int…
the second one give no issue. In the database EntityCD exist in all 3 tables as integer nullable but the data does not have null value.

Look like the first item need to be a string. Can you confirm please.

If you’re going to specify order, use a custom .Select() to select the fields you want in order, e.g:

.Where(x => x.EntityCd == entityCd)
.Select(x => new { x.OrderNum. x.EntityCd, ....});

Multiple tables .Select() example:

.Select<A,B>((a,b) => new { a.OrderNum, b.EntityCd, ... });