title: Asp.net core, Adaptive card to return a formatted date
body: <p>Hello I am new to adaptive cards and coding in asp.net core.
  Below is an example of where I want to format the date shown in the adaptive card before showing it to the user. However when I format the code, I was only able to return 1 value from the List of <strong>AttendanceMonthlySummaryResponse</strong> (it has <strong>Date, InTime, OutTime and Workhours</strong>) returning as a list which contains many records for a specific month and year.
  How can I return all the elements of the month, right now I am only able to return just one value.</p>
  <p>P.S: <strong>FormatMonthlyAttendance</strong> function is not used here, in the current way it returns all my data when a month is selected however, the records are shown in the full date format which is unnecessary and irrelevant.</p>
  <pre><code>public class AttendanceMonthlySummaryCard
      {
          public List&lt;Attachment&gt; Create(List&lt;AttendanceMonthlySummaryResponse&gt; attendanceInfo)
          {
              List&lt;Attachment&gt; cards = new List&lt;Attachment&gt;();
              var json = File.ReadAllText(&quot;cardtemplates/AttendanceMonthlySummary.json&quot;);
              
              
              var attendanceMonthly = new
              {
                  AttendanceMonthly =  attendanceInfo 
  
                 
                 
  
              };
  
              
              
                  AdaptiveCardTemplate template = new AdaptiveCardTemplate(json);
  
                  var result = AdaptiveCard.FromJson(template.Expand(attendanceMonthly));
  
                  Attachment attachment = new Attachment()
                  {
                      ContentType = AdaptiveCard.ContentType,
                      Content = result.Card
                  };
  
                  cards.Add(attachment);
              
              return cards;
          }
  
         private object  FormatMonthlyAttendance(List&lt;AttendanceMonthlySummaryResponse&gt; attendanceMonthlyData)
          {
              if(attendanceMonthlyData == null)
              {
                  return null;
              }
            
              foreach (var am in attendanceMonthlyData)
              {
  
                  
                      return new
                      {
                          Date = am.Date.ToString(&quot;yyyy MM dd&quot;),
  
                          InTime = am.InTime.ToString(&quot;hh:mm&quot;),
  
                          OutTime = am.OutTime.ToString(&quot;hh:mm&quot;),
  
                          WorkedHours = am.WorkedHours.ToString(&quot;F&quot;)
                      
  
                  };
              }
  
              return attendanceMonthlyData;
              
                 
              
                  
                  
          }
  
          
  
          
      }
  }
  </code></pre>