Replies: 1 comment 5 replies
-
The code you have here does work because it doesn't involve modules. If // Assembly A:
public interface IMyInterface { }
internal class MyInterfaceImpl : IMyInterface { }
[Register(typeof(MyInterfaceImpl), typeof(IMyInterface))]
public static class Module { } // Assembly B:
[Register(typeof(Application))]
[RegisterModule(typeof(Module))]
public partial class Container : IContainer<Application>
{
// In the generated partial part of this class, what does the codegen look like to obtain an IMyInterface?
}
public class Application
{
public Application(IMyInterface myInterface) { }
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am not sure how or is it possible to be able to register classes in the executing assembly container of different modules/assemblies without the need to make the types public.
Example:
Assembly A contains those types
Executing Assembly need to register the dependency this way
but it can't because MyInterfaceImpl is internal clas
Is it possible to avoid making MyInterfaceImpl public and still be able to register the dependency?
We currently use Unity container and we do this by exposing extension method in Assembly A which register the dependencies on the container instance. The Executing assembly calls this method. This way we have encapsulation on module level but still be able to register dependencies.
Beta Was this translation helpful? Give feedback.
All reactions