I need to get expression name for query alias.
I need it:
Customer customer = null;
string expressionAdresses2Number = ExpressionUtils.PathString(() => customer.Adresses[2].Number);
And the result I would like was "Adresses[2].Number", but I could only get"Adresses.Number", I couldn't get the array part of the expression.
I tried this example: https://dotnetfiddle.net/eJ5nvl (based on this example: https://stackoverflow.com/a/22135756/2290538)
Does anyone have any suggestions how to get the expression part of the array with index selected "[2]"?
Model example:
public class Customer
{
public int Id { get; set; }
public Adress Adress { get; set; }
public IList<Adress> Adresses { get; set; }
}
public class Adress
{
public int Id { get; set; }
public int Number { get; set; }
}