I need to create a project with WebAPI to consume some procedures from a remote SQL database, for example: sp_retornaProdutos(1)
transforming this to /produtos/1
and returning the result in JSON .
I thought about creating models and response , like this:
// Model para envio de parâmetros
public class ProdutoReq
{
int id;
}
// Model para retorno do resultado
public class ProdutoRes
{
int id;
string nome;
string descricao;
decimal preco;
}
I would like to know how you indicate to build this application, which design pattern to use?