Questions tagged as 'asp.net-web-api'

1
answer

Api to delete is not working, does not delete. A Stored Procedure on the bank is working

This is the API public class DeleteCidade { BancoContext banco = new BancoContext(); public void deleteCidade(int id) { banco.Database.SqlQuery<Cidade>("exec sp_del_cidade", new SqlParameter("@id"...
asked by 08.08.2018 / 21:43
1
answer

Changing the select in SP gives error [closed]

This is the error: System.Data.Entity.Core.EntityCommandExecutionException: 'The data reader is incompatible with the specified 'TreinamentoCrudApi.Context.Cidade'. A member of the type, 'id', does not have a corresponding column in the data r...
asked by 10.08.2018 / 14:59
1
answer

Date Formats API + C #

I developed the system in layers, and I have 2 layers, where layer number 1 is my API and number 2 is where I store my classes. In one of the classes I have a field of type DateTime . I created a method in my API that receives an o...
asked by 25.10.2018 / 17:10
2
answers

Problems with routing using asp.net core

When trying to route a core 2.0 application, I can not reach the controller. public class GetClientController : Controller { LoadClient loadClient = new LoadClient(); [HttpGet] public IEnumerable<Cliente> Get...
asked by 18.06.2018 / 23:00
1
answer

How to use a padleft (11) in a get in the API

This is the method I have in my MVC public async Task<List<FuncionarioViewModel>> GetFuncionariosVM() { string url = $"http://localhost:56137/api/GetFuncionario"; var response = await client.GetStrin...
asked by 13.08.2018 / 15:04
1
answer

Catch the return of a WebAPI method? [closed]

I have the following code and I want to get a return on the result variable if it is true or false, how could I do this? //http://localhost:1608/api/ApiCidade/deletar/cliente/10 [HttpDelete] [Route("deletar/cliente/{id:int}")] public HttpRespo...
asked by 06.11.2015 / 02:50
1
answer

Map Api port in an MVC project

I created an MVC project and within an API. I need to get the API when I upload the project to (F5). Example, I created a service that is a GET in my Type table. How can I map the API to be able to get inside an MVC controller? My pr...
asked by 08.08.2018 / 19:54
1
answer

Return query with more than 1 parameter in WebAPI

I have the code below, how would the correct route look? How can I test the call //http://localhost:1608/api/ApiCidade/consulta/clienteLoginSenha/ [HttpGet] // [Route("consulta/clienteLoginSenha/{email:long}/{senha:long}...
asked by 06.11.2015 / 18:54