view 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
line wrap: on
line source

using System;
using Implab.ServiceHost.Unity;
using Implab.Xml;
using Unity;
using Unity.Injection;

namespace Implab.Playground {

    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; }
    }

    public class Program {

        static void Main(string[] args) {
            var container = new UnityContainer();

            var containerConfig = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml");

            Console.WriteLine($"container: {containerConfig.Registrations.Count}");
        }


    }
}