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

3
answers

Is it correct in a DTO class to have attributes of two or more tables?

I need to return on a REST data from two tables, to be consumed in an Android / IOS App, developed with xamarin. As I return a DTO, I found it good to bring data from two tables in this DTO, but I find it somewhat gambi. The other solution would...
asked by 31.08.2017 / 13:56
1
answer

How to configure Web API with multiple Get

I need to provide in my web api three forms of query: First Get with all records "GetAll", the second GET by the id and a third GET with filtering options, sent by the client eg Name contains the letter " the "and address contains the word" brid...
asked by 15.07.2016 / 19:55
1
answer

Web Api Client in Windows Forms

I'm making a client using Web Api. My site has the Web server function Api. I found this reference from Microsoft link which has an example client: static async Task RunAsync() { using (var client = new HttpClient()) { client...
asked by 05.05.2014 / 20:23
3
answers

Dependency Injection in Controller Base

Well I'm learning to work with dependency injection now and would like to apply it to my project. However I came across the following difficulty, I have a base controller where it is inherited by three other base controllers that perform the ove...
asked by 20.03.2018 / 21:12
2
answers

Multiple projects in MVC and WebAPI

I'm looking for a project template that involves multiple MVC and WebAPI projects. In the solution I'm thinking of designing (if possible) a content management solution for multiple clients and I'm thinking this way: I wanted to have a Pai pr...
asked by 08.02.2016 / 21:45
1
answer

Best practices when filtering a query with EntityFramework

I have a method in web api that receives a model from a search form and according to its values, it starts to filter the result of this search, as shown below. public HttpResponseMessage Buscar([FromBody]BuscarModel model) { C...
asked by 04.01.2016 / 19:44
1
answer

REST Fundamental Principles

In this Infoq article , the author highlights the five fundamental tenets of REST: Give all things an Identifier Link things (resources / identifier) Use standardized methods Features with multiple representations Communicate wit...
asked by 23.09.2015 / 03:17
1
answer

Customize URI templates using OData

I'm working on a project that contains the Microsoft.AspNet.WebApi.OData package, which offers a simplified implementation for OData V3 support, just use the EnableQueryAttribute attribute in the methods or classes where we want...
asked by 14.08.2018 / 16:23
1
answer

Where and how do I save the API's authentication token?

Hello, I'm having an angled application, which will consume a API . For this to happen, I must send POST to another API , which serves only to generate a token that I will pass on all other requests. My question is this...
asked by 03.05.2018 / 15:49
1
answer

Individual User Account between MVC and WebApi projects

I have an MVC project with Individual User Accounts, I use Roles for access management and everything works fine. I recently had the need to create a file manager on another server, I created a WEB API project and I communicate via HttpClient, t...
asked by 04.06.2017 / 18:52