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

1
answer

How to save and return images with Web Api?

How to send and return images of a Web Api from Controller of a Asp.net MVC application? In my Controller of project Asp.net MVC I get from View an image of type HttpPostedFileBase and need to...
asked by 06.06.2014 / 21:37
1
answer

Correct way to make one-to-many relationship 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; s...
asked by 05.07.2016 / 14:40
2
answers

How 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 bit larger the list comes empty in my API. When the list is smaller I get the expected result: Howeverwhen...
asked by 25.10.2017 / 15:15
2
answers

Create route to webapi method with parameters via querystring

I have the following route in the WebApiConfig class of an AspNet WepApi project config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "{controller}/{action}/{id}" ); Edited: Using the @G...
asked by 27.08.2017 / 21:35
2
answers

How to get cookie in Web API in a Forms Authentication scenario in Cross Application?

I have the following .Net applications: Web Application with Forms Authentication (I'm not using the MVC, I use Backbone.js to make calls to the REST API) Web Application REST API sharing the same Forms Authenticaion used in application 1....
asked by 07.07.2016 / 15:31
1
answer

How to decrease byte array size representing 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 would like to know if you can reduce this size, compressing and removing the quality of the...
asked by 29.04.2016 / 01:38
1
answer

Using Data Annotations to validate fields in an HTML page and Web API

Someone has an example of how to create a field validation on an HTML page using Data Annotation, Web API and C #. In MVC with you, this is easily accomplished by using Wizard when creating a View.     
asked by 16.12.2014 / 19:51
2
answers

Global exception handling with Web API 2

I want to use Global Error Handling with WebAPI 2. I created a new project, inside it I created the following class: ErrorLogTest.cs using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Sys...
asked by 31.05.2015 / 22:35
1
answer

WEBAPI AND CERTIFICATE A3 - TOKEN

Is anyone here able to use A3 type certificate for a WEBAPI? Because when I test it in debug (ie, local), everything works normal. But if I compile, and put in the IIS application, it keeps returning to me that there is no certificate. Has an...
asked by 29.12.2015 / 14:28
2
answers

Web Api 2 - Routings are not working

I created a web service REST using Web Api 2, and in development everything is functional. I'm using a small variation of the default route: config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{numProtocolo...
asked by 26.02.2014 / 20:45