I have something like this:
private async Task<ProductDo> GetProductsAsync(int tariffId)
{
var filter = new MyFilter
{
Expression = (x, _) => x.Id == tariffId || x.MarketingProduct.Id == tariffId,
...
};
...
My goal is to be able to record the filter to logs and also pass it as an HTTP request.
When I use ToString
method of the expression, I see a weird closure or something representation like:
(x, _) => (x.Id == value(Services.InternetTariffService+<>c__DisplayClass3_0).tariffId)
But I would love to see:
(x, _) => (x.Id == 777)
Any idea how could I achieve this? Is it even possible?