❔ rename tuple
is returning
item1: [{…}]
item2: 1
How can I rename it to sales and totalSales
16 Replies
I'd probably just use a record here instead of a tuple
But
return (sales: sales, totalSales: sales.Count())
should work
With the return type being
Task<(List<SalesReportEntity> sales, int totalSales)>
this not necessary actually, if you specify the names in the return type
wont change :-:
![](https://utfs.io/f/df5ce955-ea30-4b4a-b3bd-0157f1377745-1nq2cb.png)
Cyberrex#8052
REPL Result: Success
Result: string
Compile: 444.748ms | Execution: 52.984ms | React with ❌ to remove this embed.
huh
I guess STJ doesn't serialize named tuples
Thankfully, solution is simple: just use a record
you right
![](https://utfs.io/f/0a1078bd-d631-4851-bde1-2615902f0a56-1nq2cb.png)
return new SalesResume(sales, sales.Count());
idk if I did best way
![](https://utfs.io/f/347c4b41-a9c1-4fee-93bd-cdc24d901bc9-1nq2cb.png)
I'd just keep the record next to the method tbh, no need to make a whole separate file for it
But, sure, it works either way
Interface need to be typed as well
I'd prefer but I couldnt
Yeah, understandable
thanks
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.