Hi there,
I wonder if anyone can confirm the naming convention that i am using is correct, i have just started and really don't want to get into a bad habit
Here is what i have ... (see comments)
basically i have a mehtod called GetTasks but the uri is Tasks - i presume this is the way to go??
Also i have a method called GetUser where the Uri is (plural) Users/{id}
Any confirmation before i continue would be great.. thanks..
here are the methods i have currently..
[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();
}