title: Reflection doesn't get the custom class in C#
body: <p>I created a method to return a default field value from any class. I am trying to use <code>Reflection</code> to get the value, but it doesn't work.</p>
  
  <p>Here is the class with the default value that I want (<code>StoredProcedure</code>):</p>
  
  <pre><code>namespace Services.Data.Report
  {
    public class PayrollReport
    {
      public string FullName { get; set; }
      public DateTime WeekStart { get; set; }
      public decimal PerDiem { get; set; }
      public decimal StPay { get; set; }
      public decimal OtPay { get; set; }
      public decimal StraightHours { get; set; }
      public decimal OverTimeHours { get; set; }
  
      [DefaultValue("report_payrollSummary")]
      public string StoredProcedure { get; set; }
    }
  }
  </code></pre>
  
  <p>I have this method that will allow me to pass the name of the class, and hopefully get the desired field value:</p>
  
  <pre><code>namespace Services
  {
    public class DynamicReportService : IDynamicReportService
    {     
      public string GetDynamicReport(string className)
      {
          System.Reflection.Assembly assem = typeof(DynamicReportService).Assembly;
          var t = assem.GetType(className);
          var storedProcedure = t?.GetField("StoredProcedure").ToString();
          return storedProcedure;
      }
    }
  }
  </code></pre>
  
  <p>I have also tried this, but get the same results:</p>
  
  <pre><code>var t = Type.GetType(className);
  </code></pre>
  
  <p>The problem is that <code>t</code> is never set.</p>
  
  <p>I am trying to call it with something like this:</p>
  
  <pre><code>var storedProc = _dynamicReportService.GetDynamicReport("Services.Data.Report.PayrollReport");
  </code></pre>
  
  <p>Is there another way to pass the <code>Class</code> by name and be able to access the fields, methods, and other properties?</p>