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

2
answers

Pagination with AngularJS and WebAPI

I need to make a pagination using AngularJS . Well, I made a controller to popular Table HTML . This is working now. My next step will be to page this table. I took an example on the internet, but the example the guy makes a for 1 to...
asked by 12.07.2016 / 18:57
1
answer

Doubt with WebApi data insertion

I'm using Postman: Error:"Object reference not set to an instance of an object." I have the Controller Code: //http://localhost:1608/api/ApiGuiaCidade/cadastrar/cliente //"Referência de objeto não definida para uma instância de um...
asked by 10.11.2015 / 18:25
1
answer

Error trying to create a Controller or ApiController

I created an empty Asp.Net Core 2.0 project (without scaffold). Model DDD and etc. But when I try to create my controller, it is inherited from ApiController or Controller, it gives error:    Controller is a namespace, but is used as a type...
asked by 18.06.2018 / 16:56
1
answer

Turning the HttpResponseMessage return into JSON

My API currently returns the bank values in JSON. If no value is found, I return a HttpResponseMessage with error code 404. However, when testing the request, only the message contained in Content is displayed. I would lik...
asked by 14.02.2018 / 18:44
2
answers

Select columns dynamically with Linq

I have an action in an API that should return a template, however the fields that must be returned are entered in the request. I can query with the System.Linq.Dynamic.Core package, but the performance is pretty bad. What other alternative can I...
asked by 09.10.2018 / 18:50
2
answers

Api with Array of items does not receive the data posted

I have an Api that receives the data posted as it shows the image, it happens that the data is coming empty, I appreciate the help. //http://localhost:49764/api/unidade/carrinho/consultaUnidadeAtendimento[HttpPost][Route("unidade/carrinho/co...
asked by 07.12.2017 / 13:30
2
answers

What is the best way to handle Exceptions and Log in WebAPI (C #)? [duplicate]

Scenario: WebAPIs in .NET 4.x Objective: Improve Logging (info, error, debug, warning) and Exception Handling, for example, logging exceptions, which frameworks do Logs use? Where do they usually store Logs? I found a tool called DataD...
asked by 14.11.2017 / 16:13
1
answer

How to read a JSON file using C #?

I have my code that reads an external API and returns me information, I would like to read this information or add it to a class: I'm using Newtonsoft.Json; This is Json: { "success": true, "errorMessage": null,...
asked by 06.12.2017 / 13:21
1
answer

Does not display data on Api web screen asp.net mvc

I started to study a little web api using with asp.net, I am doing a very simple example where I just want to list the data of the employee table, but I get error: No MediaTypeFormatter is available to read an object of type 'IEnumerable'1' fro...
asked by 02.03.2018 / 00:57
1
answer

Send parameters to Restfull services [closed]

I have a mvc web application and I have an action that should pass a parameter to a REST service. How do I pass a parameter to a REST service. I know I will have to implement an HttpPost, but how? Anyone know of a tutor who can help us? EDIT...
asked by 18.10.2017 / 19:50