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