Mercurial > pub > ImplabNet
annotate Implab.Playground/Program.cs @ 269:ff581cff7003 v3
Working on Unity container xml configuration
author | cin |
---|---|
date | Tue, 24 Apr 2018 01:46:02 +0300 |
parents | 0be8a6ae8307 |
children | ade80d94dfb5 |
rev | line source |
---|---|
267 | 1 using System; |
268 | 2 using System.Diagnostics; |
3 using Implab.Diagnostics; | |
267 | 4 using Implab.ServiceHost.Unity; |
229 | 5 using Implab.Xml; |
267 | 6 using Unity; |
7 using Unity.Injection; | |
229 | 8 |
9 namespace Implab.Playground { | |
267 | 10 |
11 public class Foo { | |
269 | 12 |
13 public class Bar { | |
14 | |
15 } | |
16 | |
267 | 17 public int IntValue { get; set; } |
18 | |
19 public string StringValue { get; set; } | |
20 | |
21 } | |
22 | |
23 public class Container<T> { | |
24 public Container() { | |
25 | |
26 } | |
27 | |
28 public Container(T instance) { | |
29 Instance = instance; | |
30 } | |
31 | |
32 public T Instance { get; set; } | |
33 } | |
255
b00441e04738
Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents:
236
diff
changeset
|
34 |
229 | 35 public class Program { |
36 | |
255
b00441e04738
Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents:
236
diff
changeset
|
37 static void Main(string[] args) { |
267 | 38 var container = new UnityContainer(); |
255
b00441e04738
Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents:
236
diff
changeset
|
39 |
269 | 40 var conf = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml"); |
233 | 41 |
269 | 42 Console.WriteLine($"Registrations: {conf.Registrations.Count}"); |
268 | 43 |
233 | 44 } |
229 | 45 |
46 | |
47 } | |
48 } |