title: Visual Studio C# Web API Project code in class not executed
body: <p>I am new to the C# community. I created a controller and a class with the class containing some logic from a COM reference that I want to be executed.</p>
  <p>When I call the API, it does not seem to be going into the ImportInventory method and no logic is executed in that public string (as seen from the debugging breakpoints).</p>
  <p>Can someone please assist on how to get this part of the code executed? I am new to C# and can't seem to find the issue.</p>
  <p>Code snippet of the controller:</p>
  <pre><code>using MDRDS_PastelIntegrator.Models;
  using Microsoft.AspNetCore.Mvc;
  
  namespace MDRDS_PastelIntegrator.Controllers
  {
      [ApiController]
      [Route(&quot;[controller]&quot;)]
      public class InventoryController : ControllerBase
      {
          private readonly ILogger&lt;InventoryController&gt; _logger;
  
          public InventoryController(ILogger&lt;InventoryController&gt; logger)
          {
              _logger = logger;
          }
  
          [HttpPost(Name = &quot;POSTInventory&quot;)]
          public IEnumerable&lt;POSTInventory&gt; Get(string pParameter, string pPath)
          {
              return Enumerable.Range(1, 1).Select(index =&gt; new POSTInventory
              {
                  Parameter = pParameter,
                  Path = pPath
              })
              .ToArray();
          }
      }
  }
  </code></pre>
  <p>Code snippet of the class:</p>
  <pre><code>namespace MDRDS_PastelIntegrator.Models
  {
      public class POSTInventory
      {
          //public string? StrReturn;
  
          public string? Parameter { get; set; }
          public string? Path { get; set; }
  
          public string ImportInventory(string Parameter, string Path)
          {
              var SDK = new PasSDK.PastelPartnerSDK();
  
              //Set License
              var F_GetLisence = new SetLicense();
              F_GetLisence.MethodSetLicense();
  
              //Set Data Path
              var StrReturn = SDK.SetDataPath(Path);
  
              if (StrReturn == &quot;0&quot;)
              {
                  var StrIn = Parameter;
                  var StrCodeIn = StrIn;
  
                  //Import Inventory Item
                  StrReturn = SDK.ImportInventory(StrIn);
              };
  
              //Blank return string - No serial number
              if (StrReturn.Length == 0)
              {
                  StrReturn = &quot;Serial Number Not Specified.&quot;;
                  //return StrReturn;
              };
  
              //Get Result Code
              if (StrReturn == &quot;0&quot;)
              {
                  StrReturn = &quot;0 = Success&quot;;
              }
              else
              {
                  StrReturn = &quot;1 = Unsuccessfull&quot;;
              };
  
              return StrReturn;
          }
  
      }
  }
  </code></pre>