私が使用している命名規則が正しいことを誰かが確認できるのだろうか.
これが私が持っているものです...(コメントを参照)
基本的に GetTasks というメソッドがありますが、URI は Tasks です。
また、Uri が (複数の) Users/{id} である GetUser というメソッドがあります。
続行する前の確認は素晴らしいでしょう..ありがとう..
ここに私が現在持っている方法があります..
[WebGet(UriTemplate = "Tasks")]
public List<SampleItem> GetTasks() //RETURNS a COLLECTION
{
// TODO: Replace the current implementation to return a collection of SampleItem instances
return new List<SampleItem>() { new SampleItem() { Id = 1, StringValue = "Hello" } };
}
[WebGet(UriTemplate = "Users/{id}")]
public SampleItem GetUser(string id) // RETURNS A USER
{
// TODO: Return the instance of SampleItem with the given id
//throw new NotImplementedException();
return new SampleItem() {Id = 1, StringValue = "Hello"};
}
[WebInvoke(UriTemplate = "Users/{id}", Method = "PUT")]
public SampleItem UpdateUser(string id, SampleItem instance) // UPDATES A USER
{
// TODO: Update the given instance of SampleItem in the collection
throw new NotImplementedException();
}
[WebInvoke(UriTemplate = "Users/{id}", Method = "DELETE")]
public void DeleteUser(string id) // DELETES A USER
{
// TODO: Remove the instance of SampleItem with the given id from the collection
throw new NotImplementedException();
}