2

I have some projects in my solution, for example UI and API.

I want to create a controller instance from the API project in my UI project without adding a reference from the UI project to the the API project.

Like this:

public T CreateProxy<T>()
{
     // There is a code like this. I don't know how to use it.
     // I researched it, but I couldn't get enough info.
     var proxy = System.Reflection.DispatchProxy.Create<T, TProxy>();
     return proxy;
}

UI controller:

IParameterApi = CreateProxy<IParameterApi>();

// ParameterController is coming from API.
//( i dont know how to map it. dependency injection or what ? )

// and I've got this controllers Add, Update, Remove and more methods that I can use.

How can i do this???

canmustu
  • 2,304
  • 4
  • 21
  • 34

0 Answers0