title: Where to write 'processing code' in an asp.net mvc application?
body: <p>I have a method in my controller to read and excel into datatable and do 'bulk sql insert'. I read many documents related to putting the code in model but not sure how to separate the code based on asp.net mvc patterns.</p>
  
  <pre><code>static void ReadExcelFileSAX(string fileName)
      {
          StringBuilder sb = new StringBuilder();
          using (SpreadsheetDocument ssd = SpreadsheetDocument.Open(fileName, false))
          {
              WorkbookPart wbp = ssd.WorkbookPart;
              WorksheetPart wsp = wbp.WorksheetParts.First();
  
              OpenXmlReader reader = OpenXmlReader.Create(wsp);
              string text;
              while (reader.Read())
              {
                  if (reader.ElementType == typeof(CellValue))
                  {
                      sb.Append(reader.GetText()+"\r\n");
                  }
              }
          }
      }
  </code></pre>