ODataパスを指定してレコードを取得します。ODataパスは、ルートURIは含めずリソースパス以降を指定します。
名前空間:
GrapeCity.Forguncy.ServerApi
アセンブリ:
GrapeCity.Forguncy.ServerApi (GrapeCity.Forguncy.ServerApi.dll 内)
構文
C# |
---|
Object GetTableData(
string odataPath
) |
Visual Basic (宣言) |
---|
Function GetTableData ( _
odataPath As String _
) As Object |
パラメータ
- odataPath
- 型: System..::..String
ODataパス
例
POSTメソッドでODataパスを受け取り、それを基にForguncyテーブルのレコードを取得するコード例を次に示します。
コードのコピーC#
public class SampleApi : ForguncyApi
{
[Post]
public void GetDataSampleByOData()
{
StreamReader reader = new StreamReader(this.Context.Request.Body);
string message = reader.ReadToEnd();
using (var responseWriter = new StreamWriter(this.Context.Response.Body, Encoding.UTF8))
{
responseWriter.Write(JsonConvert.SerializeObject(this.DataAccess.GetTableData(message), Formatting.Indented));
}
}
} |
参照