Skip to content

Commit 03e5653

Browse files
authored
Update README.md
1 parent dbd75e1 commit 03e5653

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,79 @@
22
Difference Analyzer between two instances
33

44
> It's a component able to compare two instances of the same type and by reflection show the differences. Has a Asp.net webforms colorful panel to show these differences and highly configurable. You can set the depth of the object or to return specifc status of comparison like added, deleted, modified or unmodified.
5+
6+
> Example:
7+
8+
With this two instances:
9+
10+
```csharp
11+
var before = new Usuario
12+
{
13+
Id = 1,
14+
Nome = "Michael",
15+
Apelidos = new List<string>
16+
{
17+
"Mike",
18+
"MK"
19+
},
20+
Enderecos = new List<Endereco>
21+
{
22+
new Endereco()
23+
{
24+
Logradouro = "1st street",
25+
UF = new UF()
26+
{
27+
Nome = "SP",
28+
Cidades = new[]
29+
{
30+
new Cidade
31+
{
32+
Nome = "Sao Paulo"
33+
},
34+
new Cidade
35+
{
36+
Nome = "Santos"
37+
}
38+
},
39+
},
40+
},
41+
},
42+
Telefones = new List<Telefone>
43+
{
44+
new Telefone()
45+
{
46+
DDD = "11",
47+
Numero = "91234-5678",
48+
Tipo = TipoTelefone.Celular
49+
}
50+
}
51+
52+
};
53+
54+
var after = new Usuario
55+
{
56+
Id = 1,
57+
Nome = "Michael",
58+
Apelidos = new List<string>
59+
{
60+
"None",
61+
},
62+
Telefones = new List<Telefone>
63+
{
64+
new Telefone()
65+
{
66+
DDD = "11",
67+
Numero = "1234-5678",
68+
Tipo = TipoTelefone.Comercial
69+
}
70+
}
71+
72+
};
73+
```
74+
75+
Just call:
76+
77+
```csharp
78+
var analyzer = new DiffAnalyzer();
79+
var results = analyzer.Compare(before, after);
80+
```

0 commit comments

Comments
 (0)