Most voted "asp.net-web-api" questions
ASP.NET Web API is a framework for building HTTP services for clients such as browsers and mobile devices. It is based on Microsoft. NET Framework and ideal choice for Restful services.
Learn more…455 questions
Sort by count of
-
1
votes0
answers107
viewsProblem with Oauth2 JWT in Webapi2
Basically all code is working, I can generate my token, I can do everything, but I’m not able to validate the token. My code is like this when I call the api. What happens is: I’m sending the…
-
1
votes1
answer99
viewsDoubt with Enablecors Asp.net web.api
When is the release of an address made using the Enablecors can be used the Route or is it necessary to change something? is correct this way? [HttpGet] [Route("consulta/BuscaTipoPagamento")]…
-
1
votes0
answers76
viewsWebapi (.NET Core) has no performance gain when using async
I’m implementing an asynchronous api, but I haven’t seen much performance gain. I used Restful Stress for Chrome to do my tests, I simply didn’t see performance gain when using async. I thought this…
-
1
votes1
answer954
viewsCreate Json with a large amount of Data and Return with Webapi
Scenario: I have a Webapi that executes a method in my service layer that executes a query either returns 500k result lines, containing 90 columns. Method that makes the query and traverses the…
-
1
votes1
answer428
viewsConsuming web api with various models
In that question of mine Doubt Verb GET Webapi I face some mistakes because of relationships. But now taking it as a basis on account of my models, how could I consume this service? Because the…
-
1
votes1
answer365
viewsConsume php Web Api
I need to consume the following XML: <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> <NewDataSet> <CarregaMunicipioFranqueados>…
-
1
votes0
answers49
viewsTransaction 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 pass a transaction. Error message (Last Innerexception):…
asp.net-mvc postgresql entity-framework-6 asp.net-web-apiasked 7 years, 6 months ago Maicon Matsubara 11 -
1
votes2
answers1052
viewsUnity installation is giving error
I went to install Unity for DI and the Nuget is giving an error, I did not understand, it seems to me that it points to the Newtonsoft, see the error below: Install-Package : An error occurred while…
-
1
votes0
answers261
viewsAccess-Control-Allow-Origin in different environments
I have a very strange problem: the same code works locally and in Prod, but does not work in Homolog. Basically, the problem is Homolog (logo on login) is this: Xmlhttprequest cannot load…
-
1
votes1
answer767
viewsNewtonsoft.Json.Jsonreaderexception When making a POST
I’m having trouble doing the post in my API my app up to register the object but then it locks the application and closes with this error of execution: Newtonsoft.Json.Jsonreaderexception:…
-
1
votes0
answers55
viewsUpdate rate Limits at Runtime using Webapithrottle is not working
I have a Webapi in ASP.NET MVC and I need to control the access limit, in addition, I need to change the limits values at runtime. I implemented as this example on the site Webapithrottle (section…
-
1
votes1
answer100
viewsIcollection in Put Webapi method
I have the Put method in a Webapi Rest service // PUT: api/pessoas/5 [ResponseType(typeof(void))] public IHttpActionResult Putpessoa(int id, pessoa pessoa) { if (!ModelState.IsValid) { return…
-
1
votes1
answer598
viewsPath to the Webapi URL
I have a Webapi Rest service, I managed the controllers by the wizard that defined the answers in "api/{controller}/{id}", such as get by id: // GET: api/pessoas/5 [ResponseType(typeof(pessoa))]…
-
1
votes1
answer550
viewsSave form-data in webapi C#
I have the following code in Angular 2 for a form-data post method: upload(event) { let files: FileList = event.target.files; let formData = new FormData(); for (let i = 0, f; f = files[i]; i++) {…
-
1
votes1
answer414
viewsDeserialize JSON with Restsharp and Javascriptserializer
I am having difficulty deserializar a JSON. I am receiving the following content: "response":{ "account":{ "name":"Evandro Teste", "owners":[], "creationDate":"2017-07-07T07:18PDT",…
-
1
votes1
answer102
viewsProblems while recovering data from BD with Entity 6.1.3 and Web API
I did a test project, called quotation to use the Web API and Entity. Well, I went to my web.config and created my connection string like this: <add name="CotacaoContext" connectionString="Data…
-
1
votes1
answer383
viewsPublishing on Azure - Filenotfoundexception: Could not find file’D: home site wwwroot myapp.xml'
I am trying to publish an ASP.NET Core Web Api application for an Azure App Api feature. This error started to appear after I marked "Remove Additional files at Destination": And after that, I…
-
1
votes1
answer358
viewsHow to log a post into a web api
I want to know what the Web Api is receiving in the Post that I am sending. This is the code I’m using. var httpWebRequest =…
-
1
votes0
answers663
viewsAsp.net C# DDD - Implementing Web Api
I’m developing a DDD structure system with Simple Injector. When developing the WEB API, the data returned from the BD is null. In other tests performed in the MVC view, the same data is returned…
-
1
votes2
answers100
viewsMy App does not load list of items
I have a App Xamarin.Formsthat consumes two services rest. The first service, consumes normally. However, the second, that I need to pass a parameter, this is not being consumed. I’ve tried several…
-
1
votes1
answer502
viewsService is not being called to update the database
I did a job and when I call on URL, passing the appropriate parameters, does not work: Call on URL: http://localhost:9078/api/atualiza/1000012120/teste My service: public class AtualizaController :…
-
1
votes1
answer345
viewsWhen running the POST passing object via the URI of a Webapi, the object arrives as null in the method
I am a few days beating head with this problem I have a fronted MVC5 application and it sends an object to another Webapi application in a Save method(). See the code of my Frontend application that…
-
1
votes0
answers88
viewsRoute is not being located on my site, but works on localhost
I have a service, with verbs GET and PUT. On localhost is ok, but when I host on my site I get this mistake, only when I call the PUT: IIS 7.5 Detailed Error - 404.6 - Not Found According to the…
-
1
votes1
answer174
viewsCall PUT method from an Xamarin.Forms App
I need to do an update of mine App. I’m having some doubts to pass the proper parameters to the URL of the service and perform the PUT. The service is working, testing by Postman, I can perform the…
-
1
votes1
answer239
viewsGood Practice in APIS Rest Full with PHP and Doctrine ORM 2
Currently we have a system that uses Doctrine ORM2, we have our Entities, and themes our DAOS, within our DAOS classes we have several methods that we use to make queries, Change, Insert and Delete…
-
1
votes1
answer169
viewsError While Running Migrations
Friends, I have two entities Deliveryfee and City, where Deliveryfee has a FK from City, when I went to withdraw the relationship between the two and ran the Migration he returned me the following…
c# asp.net-mvc entity-framework asp.net-web-api migrationsasked 7 years, 1 month ago Thiago Ubiratan 353 -
1
votes2
answers51
viewsFiltering through empty children
I have two entities (TipoDeRequerimento and TipoRequerimentoSituaçãoAcademica) in my query. Today I can make a filter to bring the Types of requirements that have a certain academic situation…
c# asp.net-mvc asp.net-web-api lambda-expressions linq-to-entitiesasked 7 years, 1 month ago Thiago Ubiratan 353 -
1
votes2
answers50
viewsHow to send 1 object and 1 vector to a C# API with $http.post?
In my application I created a C#API, which is consumed by my web application in Angular. I need to pass 1 object and 1 vector as parameters to the API, but the content arrives empty in the API, how…
-
1
votes0
answers81
viewsProblem when climbing Web Api in Asp.net core using Entity framework with postgresql
Hello! So, I already checked my classes in the bank, I successfully mirrored and started to assemble the functionalities of my webservice. With that, I came across the following mistake:…
-
1
votes1
answer86
viewsError sending a route to the same api/Controller/Action in a Webapi
I’m having the following error, I perform the following operation: // POST: api/Funcionario/AddFuncionario [HttpPost("AddFuncionario")] public IActionResult AddFuncionario([FromBody] Funcionario…
-
1
votes2
answers220
viewsWhat is the best way to treat Exceptions and Log in Webapi (C#)?
Setting: Webapis in . NET 4.x Goal: Improve Logging (info, error, debug, Warning) and Exception Handling, for example, log in exceptions, which Log frameworks do you use? Where do you store Logs? I…
-
1
votes2
answers3016
viewsDoubt with Webrequest get method passing token
I’m trying to read the data of an order, where I send the information via get, Error: Unable to send content with this verb type. public string ConsultaPedido(string urlpedido, string NumeroPedido)…
-
1
votes1
answer1370
viewsHow to read a JSON file using C#?
I have my code that reads an external API and returns me the information, I would like to read this information or add them in a class: I’m using Newtonsoft.Json; This the Json: { "success": true,…
-
1
votes2
answers384
viewsApi that receives an Item Array
I have the following situation, I need to create an API that will receive the content below: { "numeroCarrinho": 122865, "itens": { "PA00058": 1, "MA00068": 1, "PA00004": 1 }, "cep": "41706670",…
-
1
votes1
answer162
viewsHow to read class data
I have an api that when receiving the data fills a class, I want to do a while in this class tb_dados_api and tb_carrinho, take the data to record in the database, how could I do that? Thanks Here I…
-
1
votes0
answers512
viewsHow to hide properties of an ASP.NET Core model entity only in JSON rendering?
I am starting studies with ASP.NET core Web Api, and am implementing the User class, which has a Password property. Logically I don’t want the password to be visible in the Jsons of the api. I’ve…
asp.net entity-framework asp.net-web-api asp.net-coreasked 6 years, 11 months ago Rômulo O. Torres 437 -
1
votes1
answer64
viewsCreate nuget package from a REST web API application
I have a WEB API REST service in ASP.NET CORE 2.0 multiple projects(layers) in it. However, by larger forces, it cannot be used as a service. It was then suggested to create a nuget package for this…
-
1
votes2
answers185
viewsLosing the bar ("/")
Follows code: var token = "bHhETtde1UhKpwUVmTsNTpXZKyfZGK8/"; var token_string = Uri.EscapeDataString(token); //"bHhETtde1UhKpwUVmTsNTpXZKyfZGK8%2F" HttpResponseMessage response = await…
-
1
votes1
answer38
viewsGet Method with Customizable Where
I made a WebAPI (ASPNET with EF6) with verb support Get(), Post() and Delete(). At some point, I need to access certain values that are not returned by default by verbs, for example: The Order…
-
1
votes2
answers215
viewsIs it possible to have Identityserver4 and Authorization authentication in the API separately?
I recently asked a question in stackoverflow in English, but I may have expressed myself badly and I did not get the answer I wanted. Link in English. I have 3 different applications: Identityserver…
asp.net-mvc asp.net asp.net-web-api asp.net-core identity-serverasked 6 years, 8 months ago Raul Medeiros 152 -
1
votes1
answer154
viewsProblem changing entity with E.F and Dapper
I have a Dapper query, where I search for an entity: var fatura = ObterPorClientedEDataVencimento(cobranca.ClienteId, cobranca.DataCobranca); The method and properties of my entity are in this Gist,…
-
1
votes1
answer78
viewsDelete Oracle - Web Api
I’m trying to make this springboot code, become a code in Webapi @RequestMapping("/deletarEvento") public String deletarEvento(long codigo) { Evento evento = er.findByCodigo(codigo);…
-
1
votes0
answers136
viewsFixed - Problem with a Web Api calling another Web Api
I am beginner developing for web environment and I am with a very bizarre problem, so the text should stay long to try to explain it. I have the following scenario: A front end made in Angular that…
-
1
votes0
answers51
viewsEntity mapping with . Net Core 2
have the following entities: public class Transacao : IEntity { [Key] public int Id { get; private set; } public int LojaId { get; set; } public virtual Loja Loja { get; set; } public int…
-
1
votes2
answers1043
viewsHow to use token authentication with Webapi . Net
I’m looking at some sites about token-based authentication using the Oauth library but a question has arisen. I have a webapi that already exposes services to both an App and a Site. We already have…
-
1
votes1
answer1468
viewsHow to submit a post request using Xios and Asp.net Core Web API?
I’m making a requisition with axios with the verb post, but I’m not getting it. Note> With the verb get I can do the requisition. Object cliente: { nomeCompleto: '', cpf: '', email: '', endereco:…
-
1
votes0
answers36
viewsIs it possible to make a related Entity possible to display with Odata Expand (Webapi)?
Hello, I have a question regarding the following situation: I have an Entity that I defined in my model as Tasfafreq public partial class TarefaFreq { [Key] public int ID { get; set; } public string…
-
1
votes0
answers77
viewsObject comes null in query, even if existing
I have this method in my controller [HttpDelete] public HttpResponseMessage DeletaCidade(int id) { Cidade cidade = banco.Cidades.Find(id); if (cidade == null) { return…
-
1
votes2
answers103
viewsTransforms string to decimal within an object
I made a Viewmodel, where in the database the CPF field is decimal(11.0) and in the VM I put as String. In my API the CPF is decimal. Well, when I fill out the field and send the form to the API,…
-
1
votes1
answer36
viewsError formatting the Json
I need to generate and expose a Json via web api and the doubt is as follows: 1st. - You cannot expose the attribute "services":null, as the Json generated by me described below ? 2nd. - How do I…