|
I have next code:
public interface ISomething { }
public struct ConcreteSomething : ISomething { }
var container = new UnityContainer();
container.RegisterType(typeof(ISomething), typeof(ConcreteSomething));
var s = container.Resolve<ISomething>();
and it throws:
Resolution of the dependency failed, type = "ConsoleApplication1.ISomething", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type ConcreteSomething cannot be constructed. You must configure the container to supply this value.
So it it possible to bind a struct to an interface in Unity?
|