示例#1
0
 public IEnumerable Get(WindowOne window)
 {
     this.logger.LogInformation("Starting controller");
     modConnection.ExecuteSql("Select * from Products");
     foreach (DataRow row in modConnection.rs.Tables[0].Rows)
     {
         var dict = row.Table.Columns
                    .Cast <DataColumn>()
                    .ToDictionary(c => c.ColumnName, c => row[c]);
         yield return(dict);
     }
 }
示例#2
0
 public IEnumerable Get(WindowOne window)
 {
     this.logger.LogInformation($"Start controller {nameof(ProductController)}");
     // ADD your code here
     modConnection.ExecuteSql("select * from Product");
     foreach (DataRow row in modConnection.rs.Tables[0].Rows)
     {
         var dict = row.Table.Columns
                    .Cast <DataColumn>()
                    .ToDictionary(c => c.ColumnName, c => row[c]);
         yield return(dict);
     }
     this.logger.LogInformation($"Finish controller {nameof(ProductController)}");
 }