コード例 #1
0
ファイル: PriceController.cs プロジェクト: carloagosta/webapi
 public ActionResult <List <Dictionary <string, object> > > Get()
 {
     return(PriceResource.GetPricesList().Select(o => new Dictionary <string, object>()
     {
         { "dateISO8601", o.Date.ToString("yyyy'-'MM'-'dd") }
         , { "price", o.Price }
     }).ToList());;
 }
コード例 #2
0
ファイル: PriceController.cs プロジェクト: carloagosta/webapi
        public ActionResult <List <Dictionary <string, object> > > Get(DateTime startDateISO8601, DateTime endDateISO8601)
        {
            List <Point> points = PriceResource.GetPricesListRange(startDateISO8601, endDateISO8601);

            return(points.Select(o => new Dictionary <string, object>()
            {
                { "dateISO8601", o.Date.ToString("yyyy-MM-dd") }
                , { "price", o.Price }
            }).ToList());
        }