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

2
answers

Is it possible to handle receiving data in camel casing using OData?

In the Register method of the WebApiConfig class I have set a CamelCasePropertyNamesContractResolver public static void Register(HttpConfiguration config) { //Resto do código removido para brevidade co...
asked by 25.05.2016 / 15:37
2
answers

Partially update model with WebAPI2

I'm starting to develop a REST API using ASP.NET WebAPI2. In my controller , I'm using the PATCH method to apply partial changes to a model . I have a method that looks this way [HttpPatch] [ResponseType(typeof(void)...
asked by 12.02.2016 / 19:18
1
answer

Sharing types between API and client application

I'm developing a REST API using ASP.NET WebApi 2 and as I come from the old SOAP standard, I'm used to API-client type sharing . That is, when referencing my service in the client project, all types that are used in the API are created in the...
asked by 15.02.2016 / 14:59
0
answers

What to do when the generated token expires?

I'm developing a rest API with Framework Asp.Net Web Api 2 , using Owin . I have a android application as the client. In case, my system has users and passwords and authenticates normally. I want to know what to do whe...
asked by 01.02.2017 / 18:30
1
answer

WebApi 2.0 - ApiControllers in another Assembly do not undergo mapping if runAllManagedModulesForAllRequests="false"

I have a WebApi2 application that implements some ApiControllers . This same application references an Assembly that implements some more. All these controllers use Attribute Routing , as in the following example: [RoutePrefix("s...
asked by 31.03.2015 / 21:06
1
answer

How to make a Custom Attribute in a webapi get the passed parameter via C #

I am creating a Custom Attribute in a webapi for validation of a value and would like to know if it can capture this value from a GET request. I wanted to do it this way: [Validacao] public Empresa consularEmpresa([FromUri]string codigo){}...
asked by 02.03.2018 / 15:19
0
answers

Problem with DepencyResolver when using TestServer, difference between instantiating HttpConfiguration and not instantiating

I have a simple authorization filter that to get an instance of a service I requirement in GlobalConfiguration.Configuration.DependencyResolver . So: var service = GlobalConfiguration.Configuration .DependencyResolver.GetService(type...
asked by 29.10.2017 / 22:43
1
answer

Doubt verb GET WebApi

I currently have some compositions in my model that relate to other tables in my bank. When I set up get to bring me all the related data, I had several problems and doubts and when I could solve it, I do not know if it's the right one. Wh...
asked by 26.03.2017 / 21:01
1
answer

When testing my web C # ASP.NET locally in Fiddler it returns me a 404 error

I'm creating a stock control system with android application integration, the connection is being made through a Web Service API. However I can not test the methods that exist in it to see the results returned, I'm using Fiddler but every time I...
asked by 01.12.2016 / 21:05
0
answers

System.MissingMethodException: No parameterless constructor was defined for this object

I'm getting the following error:    System.MissingMethodException: No parameterless constructor has been defined for this object. My Controller: using BecomexTeste.Models; using BecomexTeste.Models.BracoViewModel; using BecomexTeste.Ser...
asked by 14.11.2018 / 15:10