Created
June 19, 2013 14:25
-
-
Save renatocantarino/5814718 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.ServiceModel; | |
using System.ServiceModel.Web; | |
namespace appRest | |
{ | |
[ServiceContract] | |
public interface IRestService | |
{ | |
//POST operation | |
[OperationContract] | |
[WebInvoke(UriTemplate = "", Method = "POST")] | |
Pessoa CriarPessoa(Pessoa createPerson); | |
//Get Operation | |
[OperationContract] | |
[WebGet(UriTemplate = "")] | |
List<Pessoa> ObterTodasPessoas(); | |
[OperationContract] | |
[WebGet(UriTemplate = "{id}")] | |
Pessoa ObterPessoaId(string id); | |
//PUT Operation | |
[OperationContract] | |
[WebInvoke(UriTemplate = "{id}", Method = "PUT")] | |
Pessoa UpdatePessoa(string id, Pessoa updatePerson); | |
//DELETE Operation | |
[OperationContract] | |
[WebInvoke(UriTemplate = "{id}", Method = "DELETE")] | |
void DeletarPessoa(string id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment