Ejemplo n.º 1
0
        public IBinding AddInstance <TConcretion>(TConcretion instance) where TConcretion : TAbstraction
        {
            var binding = _binder.BindInstance <TAbstraction>(instance).InList();

            _bindings.Add(binding);
            return(binding);
        }
Ejemplo n.º 2
0
 public static IBinding BindOptionalInstance(this IBinder This, object instance) =>
 instance != null?This.BindInstance(instance.GetType(), instance) : Binding.Null;
Ejemplo n.º 3
0
 public static IBinding BindOptionalInstance <T>(this IBinder This, T instance) =>
 instance != null?This.BindInstance(typeof(T), instance) : Binding.Null;
Ejemplo n.º 4
0
 public static IBinding BindInstances(this IBinder This, IDictionary <Type, object> instances) =>
 instances != null
         ? new CompositeBinding(instances.Select(x => This.BindInstance(x.Key, x.Value)))
         : Binding.Null;
Ejemplo n.º 5
0
 public static IBinding BindInstance(this IBinder This, object instance) =>
 This.BindInstance(instance.GetType(), instance);
Ejemplo n.º 6
0
 public static IBinding BindInstance <T>(this IBinder This, T instance) =>
 This.BindInstance(typeof(T), instance);