You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a mapping from an interface to a concrete class comes before a factory mapping, then an exception will be thrown is the concrete class cannot be instantiated, e.g. it has multiple constructors.
This was discovered when mapping the Amazon S3 client to the interface, like this:
setup.Register<IAmazonS3,AmazonS3Client>().RegisterFactory<AmazonS3Client>(CreateAmazonS3Client);AmazonS3ClientCreateAmazonS3Client(){// Factory function implementation.}
Since AmazonS3Client has multiple public constructors, the single constructor registration throw an exception when visited, but since it will be overridden, it should not throw an error.
If they the registrations are swapped, then no exception is thrown.
If a mapping from an interface to a concrete class comes before a factory mapping, then an exception will be thrown is the concrete class cannot be instantiated, e.g. it has multiple constructors.
This was discovered when mapping the Amazon S3 client to the interface, like this:
Since
AmazonS3Client
has multiple public constructors, the single constructor registration throw an exception when visited, but since it will be overridden, it should not throw an error.If they the registrations are swapped, then no exception is thrown.
The text was updated successfully, but these errors were encountered: