Mercurial > pub > ImplabNet
view Implab.Playground/Program.cs @ 270:ade80d94dfb5 v3
Working on Unity container xml configuration
author | cin |
---|---|
date | Wed, 25 Apr 2018 04:44:40 +0300 |
parents | ff581cff7003 |
children | d4d437ec4483 |
line wrap: on
line source
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 conf = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml"); Console.WriteLine($"Registrations: {conf.Items.Count}"); } } }