Search code examples
c#expressionnameof

nameof() operator for Multiple Levels of Properties


What is nameof() equivalent for the following expression:

query.Include(x => x.Collection.Select(y => y.Property))

Solution

  •  $"{nameof(XType.Collection)}.{nameof(CollectionType.Property)}";
    

    Would probably be the closest thing?