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
-
4
votes4
answers144
viewsProblems initializing a type within a LINQ query
I am going through the following problem, I am assembling an API for a forum application and this API needs a endpoint returning a collection of Forum who own the property ParentId nulla. Then I…
-
4
votes2
answers424
viewsMutiplos projects in MVC and Webapi
I’m looking for if there are any project models that involve multiple MVC and Webapi projects. In the solution I’m thinking about designing (if possible) a content management solution for multiple…
-
4
votes1
answer1210
viewsHow to decrease byte array size that represents an image
I have an array of bytes in Base64 that is in a string in C#. It represents an image. The size of the string is between 50 and 80 thousand characters. I wanted to know if it has how to decrease this…
-
4
votes1
answer331
viewsRight Way to Make Relationship One To Many Using C# and Mongodb
I have two entities, Sistema and Comentario where a system can have several comments: public class Sistema { public ObjectId Id { get; set; } [BsonElement("SistemaId")] public int SistemaId { get;…
-
4
votes1
answer1580
viewsHow to Set Up Multiple Web API Get
I need to provide in my web api three forms of query: First Get with all "Getall" records, the second GET by id and a third GET with ribbon options, sent by client, e.g.: Name contains the letter…
-
4
votes3
answers750
viewsIs it correct in a DTO class to have attributes of two or more tables?
I need to return in a REST data of two tables, to be consumed in an Android/IOS App, developed with Xamarin. As I return a DTO, I thought to bring in this DTO data of two tables, but I find this…
-
4
votes1
answer593
viewsReturn message together with Unauthorizedresult
I am using . NET Core 2 to create a dependency that will be injected into an API. The idea is to create a middleware to control incoming requests and act according to a number of business rules. It…
-
4
votes2
answers932
viewsHow to pass a large list of objects to API in C#?
I am passing a list of objects to my API in C#. When the list size is smaller, everything happens as it should. When the list is a little longer the list arrives empty in my API. When the list is…
-
4
votes3
answers655
viewsController Base Dependency Injection
Well I’m learning to work with the dependency injection now and I’d like to apply it to my project. But I came across the following difficulty, I have a controller base where it is inherited by…
-
4
votes1
answer94
viewsCustomizing URI templates using Odata
I am working on a project that contains the package Microsoft.AspNet.WebApi.OData, which offers a well-simplified implementation to support Odata V3 by simply using the Attribute…
-
3
votes1
answer524
viewsError sending file via Postasjsonasync method in Asp.Net MVC
In my Controller of a project Asp.net MVC I get from View a picture like HttpPostedFileBase and need to send to Web Api using PostAsJsonAsync: var response = await…
-
3
votes1
answer445
viewsWhat’s the best way to sync desktop app data with webapi?
I have my desktop application that needs to send data (just send) to a webapi, this data cannot be sent repeatedly and also after sent, not send again, the desktop app will be on. net(wpf) the…
-
3
votes1
answer85
viewsMake a project with web Api c# return an RSS
I’m needing to get my project in Rest WEB API to return RSS instead of json or XML ... I’d like to see if anyone has already done it ?
-
3
votes1
answer1275
viewsRestricting data access with REST
I would like to know if it is possible to restrict access to my application data REST. For example, I have the xml/json that she returns in http://meuapi.com/usuarios, where you return my user list.…
-
3
votes2
answers101
viewsMany Relationships for Many in Restful Service
I’m starting to work with Restful Services and I’m having doubts about many relationships for many. For example, suppose I have two entities Cliente and Fornecedor and that Cliente has a list of…
-
3
votes2
answers1107
viewsError returning list with Fluent Nhibernate
Within the Web.API project, I created a Get() method which returns a list of objects - Ilist. This Personal Classaccess has a Log list (1:N). When executing the Get() method, an exception occurs:…
-
3
votes1
answer698
viewsTesting simultaneous queries on the REST server
I have a server REST/WebApi and wanted to test its performance with simultaneous consultations. My goal is to test, logically the performance, and also if the same is treating each request…
-
3
votes2
answers478
viewsHybrid Web Application (MVC and Web API)
In Visual Studio when we create a web project it gives you the options to mark: Webforms MVC Web API When MVC + Web API frame the two are in the same project. There is some advantage/performance in…
-
3
votes1
answer350
viewsAPI’s web, REST and Object Orientation
I’m starting to study web Apis a little more in depth and I was a little bit in doubt with the following question: I work with ASP.NET Webapi and therefore with object orientation. I have in my…
-
3
votes1
answer216
viewsHow to return a message together with an Httpstatuscode
I have the following method in my Controller: public IHttpActionResult Get(string id) { var product = objds.GetProduct(new ObjectId(id)); if (product == null) { return NotFound(); } return…
-
3
votes2
answers211
viewsEntity Framework 6 Async and method . Wait()
I have a system that is a Web Api, the control runs a classes like this: public class CrawlBO { public void IniciaProcesso() { ... CarregaConfiguracaoCrawlBO carregaconfiguracaocrawlbo = new…
-
3
votes1
answer68
viewsRemove Return Header Owin Webapi
A simple return query to my REST service brings the following answer: { "Id": 1, "Descricao": "TIROLESA DE AÇO", "Und": "UND", "Fabrica": "STARROW", "Estoque": 9, "Preco": 0.39 }, But the query with…
-
3
votes1
answer1199
viewsHow to get filename within folders in WEB API server
I have a directory Archive/Uploads And I would like to list all the files, within this directory I have N folders. what I’ve got so far is here. string path =…
-
3
votes1
answer83
viewsSecurity Attributes
A friend asked me how to give more security in your application, to avoid a kind of "url injection", IE, someone manually type an "addicted" url and bypass the system. Of course, there are several…
-
3
votes2
answers135
viewsDocumenting and testing methods of an ASP.NET Core Web API
Is there any tool capable of listing the methods of a Web API and it is possible to test them? I have already researched here on the site about this and I did not find specific solutions for a Web…
asp.net-web-apiasked 7 years, 3 months ago user86250 -
3
votes0
answers84
viewsOn my site is asking for a dll that does not exist in my project
I’m having this mistake. The question is not how to solve, but understand why ERROR, if in my project this DLL does not exist. In localhost the site rises normally without this Dll. I just wish I…
-
3
votes1
answer1253
viewsUpload with ASP.NET Core json vs formdata
I’m using Asp.net core webapi, initially my actions were using the attribute [Frombody] in the parameters, so I rescued the json value sent by front-end. I am now implementing a screen that has…
-
3
votes1
answer1032
viewsHow to upload and download the same request using Angularjs and Web api?
I am developing a functionality that will receive a spreadsheet in format . xlsx, will perform a processing and return this sheet with the columns added, in which case I should upload a file and in…
-
3
votes1
answer501
viewsFill in date and time in View mvc 5 Razor
I have a registration form where I have a record date field that I currently fill in my save method, only that my server is hosted in another country where the field is being filled in from the…
javascript c# entity-framework asp.net-mvc-5 asp.net-web-apiasked 5 years, 11 months ago Thiago Ubiratan 353 -
3
votes2
answers907
viewsUnexpected type when serializing web API
I am trying to use the Web Api and getting this error while trying to serialize an array. The 'HT.Data.Client' type with data contract name 'Client:http://schemas.datacontract.org/2004/07/HT.Data'…
-
3
votes1
answer763
viewsHow to Save Files to Separate Server by Extension
I have a WEB API who receives a file via POST follows the code of Controller: public async Task<HttpResponseMessage> Post() { // Ver se POST é MultiPart? if…
-
3
votes1
answer691
viewsASP.NET Webforms, MVC or Webapi?
First I would like to point out that my knowledge in web development is very small, so my question will be directed on what to use and not how to use, because the goal is to study first and then…
-
3
votes1
answer249
viewsWhat are the differences between Container(Docker), App Service(App service) and Fabric Service in Azure?
When we publish an application, service or Web API we now have a wide range of options. I particularly like Azure for its mindset of facilitating settings across the dashboard and shifting…
windows-azure asp.net-web-api docker microservices azure-app-serviceasked 7 years, 3 months ago Alexandre Cavaloti 2,225 -
3
votes1
answer26
viewsError running Updade-Database command
When executing the command Update-Database Package Manager Console gets the following error: Value cannot be null. Parameter name: entitySet I have only one model in the project for now public class…
-
3
votes1
answer496
viewsRequest arrives null on C#
I have a request that’s being made this way at angle 5. enviarEmail(titulo: TitulosCobranca, unidade: UnidadeEmpresa) { let param: any = { titulo: titulo, unidade: unidade } return…
-
3
votes1
answer196
viewsHow to configure IIS for its proper functioning?
When I run my API by Visual Studio CTRL+F5 or F5 and open my application that consumes this API it works perfectly (Both on the same network or through NAT port forwarding). However when I publish,…
-
3
votes1
answer176
viewsAPI with JWT authentication
Hello, I am building an API for studies and I am implementing JWT in the authentication of it. All the contents I found refer to Asp.Net Core, as I do for validate tokens in the. Net Framework? I…
-
3
votes1
answer46
viewsDeserialize JSON with Newtonsoft JSON
I am trying to make an deserialize, to create a list with the contents of this JSON. However, everything arrives to the list as null. I’m gonna let down what I’ve got so far. I have the following…
-
2
votes1
answer214
viewsSave entities with one relationship to many using Webapi
I am starting a project in Webapi and came across a situation that did not know how to define my class of Controller. I have the following structure public class Artigo { public int ArtigoId { get;…
-
2
votes1
answer157
viewsCreate a record and add relationship through the httpPost Web Api
When creating a new record in the tab I need to take the ID of my main screen and send along with the new object. Currently I have this code: public async Task<IHttpActionResult>…
-
2
votes2
answers1437
viewsHow do I catch Id on the return of a Web Api Post?
I have this code on Web Api: [ResponseType(typeof(Menu))] public async Task<IHttpActionResult> PostMenu(Menu menu) { if (!ModelState.IsValid) { return BadRequest(ModelState); }…
-
2
votes1
answer1027
viewsWhen and how to use the Asp.net web api
I have been studying Asp.net MVC for some time, I have been reading about WebApi but I still can’t understand when and how I can use it. Ex: I have a small news system, where I have a area where is…
-
2
votes1
answer235
viewsCan the automatically generated . mdf database in App_data be used in production?
The automatically generated database within the App_data folder in projects Asp.Net MVC and Web-Api can be used in production or is a test basis only?
-
2
votes1
answer383
viewsSerialization - Webapi for WCF with base type property (Abstract)
I have a problem here where I have a Webapi consuming a WCF. I’m basically having trouble getting into WCF a property that’s the base type of class I’m actually sending. I’ll set an example to make…
-
2
votes1
answer108
viewsValidations in Webpapi
I’m starting to study webapi with knockout, using a classe Basic as example I made my model, in the knockout I made the list and include it in my classe I have decorated the attributes with some…
-
2
votes1
answer285
viewsUsing Identity in an Asp.Net MVC 5 application with Web Api and vice versa
When I create a project Asp.Net MVC with Individual User Accounts i can get into the application this way: var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password,…
-
2
votes1
answer780
viewsHow to capture an error occurring on a webapi server?
I have a server where runs a Webapi service, in the client I run the call to a POST URL so: try { HttpWebRequest request; request = (HttpWebRequest)WebRequest.Create(URL); request.Method = "POST";…
-
2
votes1
answer88
viewsReturn from a Windowsservices via an ASP.NET application
I have a Windows Service which at a certain time scans the machine and performs a backup, to a folder on a server on the network. The Service is running on the machines perfectly and running the…
-
2
votes0
answers959
viewsWhat to do when the generated token expires?
I’m developing an API rest with the Framework Asp.Net Web Api 2, using Owin. I have an app android as the client. In this case, my system has users and passwords and authenticates normally. I want…
-
2
votes1
answer145
viewsCustomize Json consumption - Web API
I have the following information on Json: [ { "$id": "1", "Cditemcontacli": 1.0, "Cdcontacli": 1.0, "Descricao": "Produto 1" }, { "$id": "2", "Cditemcontacli": 2.0, "Cdcontacli": 2.0, "Descricao":…