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

0
answers

Transaction with Entitiframework 6.1.3 and PostgresSql does not work correctly

I'm trying to use EntityFramework6.Npgsqlcom transaction, however I get an exception when I call the DbContext.UseTransaction method and step a transaction. Error message (Last InnerException):    "Npgsql.PostgresException (0x80004005):...
asked by 21.05.2017 / 17:50
1
answer

Controller Web API Standardization

I would like to know the following. Imagine the following URIs: (1) api / orders (2) api / orders / 10 (3) api / orders / 10 / items The URI (1) and (2) I am sure they would be inside a class called RequestsController, since to (3), I...
asked by 12.04.2017 / 19:58
1
answer

Consume Web Api php

I need to consume the following XML: <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> <NewDataSet> <CarregaMunicipioFranqueados> <Codigo_Municipio>2700201</Codigo_Municipio...
asked by 20.04.2017 / 17:48
1
answer

Consume web api with several models

In this my question Doubt GET WebApi I face some error due to relationships . But now taking it as a basis on account of my models, how could I consume this service? Because the Table1 model has relationships and I needed to bring them to the...
asked by 30.03.2017 / 03:41
2
answers

How do I disable Forms Authenitcation for the Web API?

I have an Asp.Net MVC project and inside it has the Api web, when a request sends an invalid token, the forms authentication redirects to the login page, but I need it to only return an Http 401 error as it is an Api Rest. I already tried to use...
asked by 03.02.2017 / 17:24
1
answer

Doubt with EnableCors asp.net web.api

When you are done releasing an address using EnableCors can you use Route or do you need to change anything? is this correct? [HttpGet] [Route("consulta/BuscaTipoPagamento")] [EnableCors(origins: "http://localhost:50907", headers: "*", methods...
asked by 02.01.2017 / 15:07
0
answers

Webapi (.NET Core) has no performance gain when I use async

I'm implementing an api asynchronously, but I have not seen much gain in performance. I used RESTful Stress for Chrome to do my tests, I just did not see performance gain when I use async. I thought this would increase the number of concurrent r...
asked by 10.02.2017 / 21:36
0
answers

Problem with OAuth2 JWT in WebApi2

I'm trying to get the token in the form of a token, but I'm not able to validate the token. My code looks like this when I'm going to call api. What happens is: I am sending the request with the token, but it still does not validate, the to...
asked by 16.12.2016 / 15:35
2
answers

System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value to int

I'm getting this exception in C # when I try to read SQL data. I am having doubts if this error is problem with my SQL or in C #. My SQL code that does the conversion is this: '$ (SELECT ORDEM FROM TABELA UP (NOLOCK)...
asked by 20.10.2016 / 13:47
0
answers

AngularJS $ http.post taking too long

I have a web API made in php that accesses a MySql database that has a return in JSON and I'm using Ionic + AngularJS to develop an application that will use this API. In my services.js file I created a factory for each entity in my system, l...
asked by 09.09.2016 / 15:16