謝謝各位剛剛的幫忙 不好意思 我又來了...
public IEnumerable<PriceAfterChange> Post([FromBody] OrderRequest request)
{
string redchangeday = "Select [ChangeDate],[Price] from[RoomPriceAdjust] where [ChangeDate]>=@date";
var a = this.Connection.Query<PriceAfterChange>(redchangeday,new { date=request.StartDate});
return a;
}
讀取回來的資料為
請問有甚麼辦法 能夠讓資料變成能夠這樣操作嗎
a[0].ChangeDate
a[0].Price
a[1].ChangeDate
a[1]...
.....
我把 a =this.Conn ......
改成
List<PriceAfterChange> L = new List<PriceAfterChange>();
L =(List<PriceAfterChange>) this.Connection.Query<PriceAfterChange>(redchangeday, new { date = request.StartDate });
就可以了 謝謝