Answers for "adding a dependency injection service in windows forms app"

0

adding a dependency injection service in windows forms app

public class MainForm: Form
    {

      // ..

       private readonly IMySomeThing _mySomething;

       public MainForm()
       {
        _mySomething =   (IMySomeThing)Program.ServiceProvider.GetService(typeof(IMySomeThing));
       }     

    }
Posted by: Guest on June-29-2021

Code answers related to "adding a dependency injection service in windows forms app"

Browse Popular Code Answers by Language