##// END OF EJS Templates
Working on Unity xml configuration
Working on Unity xml configuration

File last commit:

r271:d4d437ec4483 v3
r271:d4d437ec4483 v3
Show More
Program.cs
58 lines | 1.1 KiB | text/x-csharp | CSharpLexer
using System;
using System.Diagnostics;
using Implab.Diagnostics;
using Implab.ServiceHost.Unity;
using Implab.Xml;
using Unity;
using Unity.Injection;
namespace Implab.Playground {
public class Foo {
public class Bar {
}
public string Name { get; set; }
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; }
public void SetInstance(T value) {
Instance = value;
}
}
public class Program {
static void Main(string[] args) {
var container = new UnityContainer();
var ctx = new ConfigurationContext(container);
var conf = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml");
ctx.Visit(conf);
Console.WriteLine($"Registrations: {conf.Items.Count}");
}
}
}