title: Create an API in C# which can be called from it's DLL
body: <p>I know the title is bit confusing for my question.</p>
  
  <p>Let me explain:-
  There are some DLLs written by my seniors and I use them in C# as follows:</p>
  
  <p>Say, Existing DLL name is SeniorDLL and I want to use function SeniorFunc from that DLL.
  What I do is:-</p>
  
  <pre><code>private delegate int SeniorFunc(IntPtr Blah);
  
  [DllImport("kernel32")]
  public extern static IntPtr LoadLibrary(string lpFileName);
  
  [DllImport("kernel32", CharSet = CharSet.Ansi)]
  public extern static IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
  
  SeniorFunc fp_Senior;
  </code></pre>
  
  <p>and in function where I want to use this function, Before first function call I write:</p>
  
  <p>IntPtr handle;</p>
  
  <pre><code>    handle = IntPtr.Zero;
      handle = LoadLibrary("&lt;DLL Path&gt;");
  
      IntPtr fPtr = GetProcAddress(handle, "SeniorFunc");
      fp_Senior = (SeniorFunc)Marshal.GetDelegateForFunctionPointer(fPtr, typeof(SeniorFunc));
  </code></pre>
  
  <p>and then I use this function via <code>fp_Senior(&lt;Parameter&gt;);</code></p>
  
  <p>Now I want to create such DLL for me in C# by which I'll be able to call functions from DLL.
  Currently I created a DLL but I have create an instance of class in DLL and then have to access like <code>ClassInstance.MyFunction(&lt;Parameters&gt;)</code>; </p>
  
  <p>How can I get directly function calls without creating an instance?
  In other words, (I don't know I am correct or wrong) How can I create APIs??</p>
  
  <p>Thanks!!</p>