Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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));
       }     

    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: .net 6 autofac 
Csharp :: autfac .net 6 
Csharp :: selenium scroll to element c# 
Csharp :: group by unique c# 
Csharp :: unity respawn c# 
Csharp :: c# timer 30 seconds 
Csharp :: wpf how to focus on element 
Csharp :: conditional if statement c# programming 
Csharp :: c# xml comment type reference 
Csharp :: c# add key value pair to dictionary 
Csharp :: C# compare date values 
Csharp :: unity input system 
Csharp :: c# dictionary get key by value 
Csharp :: compare two strings in c# 
Csharp :: npm add auth token 
Csharp :: System.Data.Entity.Core.EntityException: The underlying provider failed on Open 
Csharp :: add list to list c# 
Csharp :: enum in c# 
Csharp :: c# creating an array 
Csharp :: c# make a automapper 
Csharp :: math with c sharp 
Csharp :: c# static 
Csharp :: how to change color of part from the text in textblock wpf 
Csharp :: Why Duplicate "..TargetFrameworkAttribute" c# assemblies created 
Csharp :: How do I allow edit only a particular column in datagridview in windows application 
Csharp :: c# group array based on first character 
Csharp :: store data between razor pages 
Csharp :: unity unhide object 
Csharp :: Send Hotmail, Outlook, Office365 Email using SMTP C# .NET 
Csharp :: c# short to int 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =