As shown, your
DataEntries
class doesn't have any properties, so there's nothing to drill down into.
Assuming you actually have some properties in there:
public class DataEntries
{
public class UserObjects
{
public string UserId { get; set; }
public string UserId2 { get; set; }
}
public class TagObjects
{
public int id { get; set; }
public string name { get; set; }
public int type { get; set; }
public TagObjects Child { get; set; }
}
public UserObjects User { get; set; }
public TagObjects Tag { get; set; }
}
then your reflection code will work as expected:
var entry = new DataEntries
{
User = new DataEntries.UserObjects
{
UserId = "42",
UserId2 = "64",
},
Tag = new DataEntries.TagObjects
{
id = 42,
name = "Ford",
type = 11,
},
};
var value = entry.GetPropValue("Tag.name");
Console.WriteLine(value);
Demo[
^]