-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
35 lines (30 loc) · 769 Bytes
/
README
File metadata and controls
35 lines (30 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Recursive reflection of pocos, enables you to do all sorts of magic.
public class WriteValueToConsoleAttribute : BaseRecursiveReflectionAttribute
{
public override void Action(object property)
{
Console.WriteLine(property);
}
}
[TestClass]
public class RecursiveReflectionTests
{
[TestMethod]
public void Usage()
{
var dto = new TestDto { MyText = "MyTextValue", MyList = new List<TestDto2> { new TestDto2 { Text = "MyText" } } };
var reflector = new RecursiveReflector();
reflector.Reflect(dto);
}
}
public class TestDto2
{
[WriteValueToConsole]
public string Text { get; set; }
}
public class TestDto
{
public List<TestDto2> MyList { get; set; }
[WriteValueToConsole]
public string MyText { get; set; }
}