What I have is:
class ABC
{
public void MethodA()
{
Console.WriteLine("In method A");
}
public void MethodB()
{
Console.WriteLine("In method B");
}
public void MethodC()
{
Console.WriteLine("In method C");
}
}
class PQR
{
public void MethodP()
{
Console.WriteLine("In method P");
}
public void MethodQ()
{
Console.WriteLine("In method Q");
}
public void MethodR()
{
Console.WriteLine("In method R");
}
}
What I want to achieve is:
Call (or maybe inject using any DI frameworks)
MethodP()
in MethodA()
,
MethodQ()
in MethodB()
,
MethodR()
in MethodC()
,
But without extending Class PQR
on Class ABC
or vice versa.
Or without modifying Class ABC
, I can Modify Class PQR
.
I did checked some of the existing DI frameworks like Prism
, Autofac
, Unity
but to use them I have to modify Class ABC
(Adding some attributes, extending to some interfaces etc.), which I don't want to do.
How can I achieve this?
UPDATE 1:
Class ABC
and class PQR
don't have any super class/interface in common.