Esempio n. 1
0
    static void Main()
    {
        var holder = new FooHolder {
            Foo = new Foo()
        };

        int    x = holder.Foo[10];
        string y = holder.Foo["hello"];
    }
Esempio n. 2
0
        public void should_inject_instance_with_explicit_type()
        {
            var foo = new Foo()
            {
                Name = "Foo"
            };
            var fooHolder = new FooHolder(foo);

            var construktion = new Construktion().Inject(typeof(FooHolder), fooHolder);

            var result = construktion.Construct <FooHolder>();

            result.Foo.Name.ShouldBe("Foo");
            result.ShouldBeOfType <FooHolder>();
            result.GetHashCode().ShouldBe(fooHolder.GetHashCode());
        }
 public void AddFooHolder(int foo)
 {
     FooHolder.Add(foo);
     LastModifiedDate = DateTime.UtcNow;
 }