public async Task<WalletTrans> getCredits(int id)
{
var credit = await _context.walletTrans.ToAsyncEnumerable().Where(r => r.Id == id).Sum(s => s.quantity);
return credit;
}
I have that code above using C#.net core that supposedly returning a summation of a filed in the table.
But I'm having this error.
"Cannot implicitly convert type 'decimal' to 'ProjectName.Models.ModelName' [ProjectName]"