Program.cs
40 lines
| 839 B
| text/x-csharp
|
CSharpLexer
/ Implab.Playground / Program.cs
cin
|
r267 | using System; | ||
using Implab.ServiceHost.Unity; | ||||
cin
|
r229 | using Implab.Xml; | ||
cin
|
r267 | using Unity; | ||
using Unity.Injection; | ||||
cin
|
r229 | |||
namespace Implab.Playground { | ||||
cin
|
r267 | |||
public class Foo { | ||||
public int IntValue { get; set; } | ||||
public string StringValue { get; set; } | ||||
} | ||||
public class Container<T> { | ||||
public Container() { | ||||
} | ||||
public Container(T instance) { | ||||
Instance = instance; | ||||
} | ||||
public T Instance { get; set; } | ||||
} | ||||
cin
|
r255 | |||
cin
|
r229 | public class Program { | ||
cin
|
r255 | static void Main(string[] args) { | ||
cin
|
r267 | var container = new UnityContainer(); | ||
cin
|
r255 | |||
cin
|
r267 | var containerConfig = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml"); | ||
cin
|
r233 | |||
cin
|
r267 | Console.WriteLine($"container: {containerConfig.Registrations.Count}"); | ||
cin
|
r233 | } | ||
cin
|
r229 | |||
} | ||||
} | ||||