Search code examples
c#reflectioninstanceservice-locator

C# - Finding instance of Class


How can i find instance of class from another application layer. I have to refresh one propertie from DAL(data acces layer) using my MV(model view). What is simplest way to finish my task. Is this possible?? I mean something like:

SomeClass someClass = FindInstance<SomeClass>([params]);

thanks for help.


Solution

  • I solved my problem with:

    SomeClass instance = ServiceLocator.Current.GetInstance<SomeClass>();