From this SO answer I'm trying to build a text replace function.
The problem is that it can't do multi level. Or at least I don't know how.
If I have this query:
var foo = await _dbContext.Foos.Include(x => x.Bar).AsNoTracking().FirstOrDefaultAsync(x => x.Id == someId);
I can do:
var fooName = GetPropertyValue(foo, "Name");
But I can't do:
var barName = GetPropertyValue(foo, "Bar.Name");
Is that possible?
public class Foo
{
public string Name {get;set;}
public Guid BarId {get;set;}
public Bar Bar {get;set;}
}
public class Bar
{
public string Name {get;set;}
}