0
votes
0answers
3 views

Proper way to deal with no results returned from JSonConvert.DeserializeObjectAsync?

I am making a call to a WebAPI method to retrieve a record by making a call like this: string uri = baseUri + "Invitation/GetByInvitationNumber?invite=" + invite; using (HttpClient client = new ...
0
votes
0answers
16 views

webapi call failing with server error

I am using ASP .net MVC 4 application. I use webapi calls to fetch data. It works fine in Test servers. When the code was deployed to production servers all webapi calls are failing. Fiddler shows the ...
0
votes
1answer
25 views

how to Secure javascript calls WebAPI from a mvc app

I've designed a mvc view in my MVC4 website which allows members to update their user details. This works ok using MVC but if i create a partial view which allows users to update their address for ...
0
votes
1answer
23 views

web api model binding to an interface

I'm trying to bind a controller action to an interface but still maintain the default binding behavior. public class CoolClass : ISomeInterface { public DoSomething {get;set;} // ISomeInterface } ...
1
vote
1answer
25 views

Custom Web API Formatting

I've been playing around with asp.net web api, and I noticed that default generated returned json doesn't include the object level key. I was also wondering how to customize the output of the json ...
0
votes
0answers
37 views

Angular.js and WebAPI CRUD examples

I have a asp.net mvc4 web application which for example allows me to manage members and member resources to the site. On the member's home page there are several different sections of details about ...
0
votes
4answers
49 views

ASP.NET web api returning XML instead of JSON

I read that by default, Web API will return JSON Data but for some reason when creating an API, it returns XML instead of JSON. public class CurrencyController : ApiController { private ...
2
votes
0answers
59 views

Web API action parameter is intermittently null

Related question: Web API ApiController PUT and POST methods receive null parameters intermittently Background While load testing an existing Web API project I noticed a lot of null reference ...
2
votes
1answer
61 views

ASP.NET MVC Web API and passing oData query

I'm currently executing Web API with oData filter requests as follows: public IQueryable<OrganizationViewModel> Get(ODataQueryOptions<Organization> oDataQuery) { var query = new ...
-1
votes
2answers
50 views

How to generate dynamic C# images? [closed]

Basically, I want to rehash VisualCube, written previously in PHP. I've looked into GDI+, tried to find books that dealt with C#, graphics, etc. Everything somewhat relevant is aimed at only ...
0
votes
2answers
48 views

How to call the webapi controller method from the different view page in mvc4 different cshtml pages like details.cshtml

This is my Controller /api/GetEmployee/1 public EmployeeVM GetEmployee(int id) { using (var db = new WorkerDBContext()) { var model = db.Employee.Find(id); ...
0
votes
0answers
18 views

Web API required field model validations not working

I have a rather strange issue. The required field model validations don't seem to work. The reason being we are using custom JSON deserializers which adds the default values to all the value types ...
0
votes
1answer
38 views

WebAPI Conflicting routes for nested resources

I am developing an API in WebAPI (First One) and i am having some issues with the specifity of routes and mapping them to the actions in my controllers for nested resources. I have the following ...
1
vote
0answers
33 views

How to force WebApi Help Page to show parent controller?

I have 3 controllers: ParentController ChildOneController (inherits ParentController) ChildTwoController (inherits ParentController) When I use the WebApi Help Page, only ChildOne and ChildTwo ...
0
votes
0answers
18 views

Setting up Web API within WCF Project

I have a little bit of a "strange practise" question. The requirement on an architecture of our project is to setup Web API with (if possible) all MVC goodness within WCF project. That means that WCF ...
3
votes
1answer
38 views

StructureMap Could not load file or assembly

I'm using StructureMap MVC on my WebAPI project. When I run the unit tests or integration tests, with xUnit and ReSharper I'm getting: System.IO.FileNotFoundException Could not load file or assembly ...
0
votes
1answer
35 views

Json Result with DataAnnotations on Model in WebApi

I am using ASP.NET WebApi , while sending result to JSON , is it possible to send Data Annotations on Model - ModelMetadata for example DisplayName attribute, ShowInEdit , ShowInDispplay and other ...
0
votes
0answers
44 views

Generic Knockout View Model for similar Models

It might be simple question but I am searching from 2 days but din't get any answer. I am working on ASP.Net MVC4 with WebApi to return API calls. So most of the KnockOut View models are same ...
0
votes
1answer
83 views

Knockout Js Binding

I am working in Asp.net mvc4 and using web api trying to bind WebApi Json Result to Knockout Js but the below binding not showing any value in text box or span <input type="text" ...
0
votes
1answer
44 views

MVC WebApi Post generates 404 not found error on AZURE

I have an MVC 4 web site with an ApiController which has a Post method. Locally everything is running just fine, I can post successfully. However after I deploy to Azure, I get a 404 message. I have ...
1
vote
2answers
52 views

I can't wrap my ADO.NET Entity Model instance in a using statement here?

I have an ASP.NET MVC WebAPI project, and I have an entry point to get one survey by ID. public IEnumerable<Models.SurveyQuestionViewModel> GetSurveyById(int id) { using (ITSurveyEntities ...
2
votes
2answers
31 views

entity framework web api always have error “The ObjectContent 1 type failed to serialize the response body…”

I use Web api to retrieve data from the database. I only have 1 table "tblMessage" and want to get data from that table. I set everything up but then when I run the website. the error always say The ...
7
votes
2answers
102 views

Why is the response from my Web API not formed properly?

I have a very basic Web API example that I constructed using the example code from this tutorial: Code Relevant Web.config Section <system.webServer> <validation ...
3
votes
2answers
68 views

ASP.NET Web API body value restriction

I'm studying ASP.NET Web API, but somewhere in the explanation about complex types that comes from the request body the author confuses me: PROFESSIONAL ASP.NET MVC 4: Chapter 11 - ASP.NET Web API ...
0
votes
1answer
19 views

How to consume web API with authentication in Excel 2010

I have an exmaple of mvc 4 web API , and I want to consume it in Excel 2010. whats the easiest way to do it? I am thinking to pass in the username and password as string parameter if solution need to ...
0
votes
1answer
32 views

How to limit the amount of data from an OData request?

I have a Users table of 76 users and UserGroups table. Using MVC, OData, a generic repository and EF, I am trying to optimize data retrieval when filtering based on the user group: ...
0
votes
2answers
72 views

Web Api Performance gain over MVC

I have a MVC web application and I make some ajax calls from the client to get back json data. Right now I just use MVC Action methods to return this data. I was wondering if I should be using the ...
0
votes
0answers
41 views

Cross-domain POST to Non-WebAPI MVC Controller

I've seen this post (and created a working demo) about implementing a "CorsHandler" to make cross-domain Web API calls but I'm wondering if it is possible to do this with a regular, non-Web-API MVC ...
1
vote
1answer
38 views

Can't bind view model properly

I want to create client side logging infrastructure using log4javascript. All logs are sent to server. That part works well. I have created WebApi controller to write those log messages on server. The ...
0
votes
0answers
26 views

How can i get the real object from the ref attribute with javascript from webapi

I have a class called Question that contains an array of Answers. These two classes contains each one an object called User. When webapi returns me the List of questions if the same user is in more ...
0
votes
2answers
70 views

ASP.NET Web API Routing in ApiController

I've been struggling with my routing for some time now and after a few days of trying to Google the solution without luck, I'm hoping someone may be able to shine some light on my problem. I have the ...
0
votes
1answer
34 views

Asp.net web api odata substringof null issue

I am using ASP.NET WEB API Odata libraries. If I use substringof in my call and the value is null it fails. The URI I am passing is: ... odata/MyEntity()?$filter=substringof(null,Name) ... And the ...
0
votes
1answer
37 views

Web API + ODataQueryOptions + $top or $skip is causing a SqlException

This code has been simplified for this example. The query is actually returned from a service, which is why I would prefer to write the method this way. [HttpGet] public ...
0
votes
1answer
41 views

Multple Post actions in one web api controller

I have a Web Api controller which as 3 post actions here are the actions: public HttpResponseMessage PostNewRecomendation([FromBody] PostNewRecomendationMessage newRecomendation) public ...
1
vote
1answer
39 views

MVC 4 Web API ModelState not using correct error description

I have followed the tutorial at http://www.asp.net/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api precisely, yet when I change the [Required] attribute on any of the ...
2
votes
3answers
119 views

ASP.Net web api post action param always coming null

I am always getting null value for my post action param in my asp.net web api. This is my action. [System.Web.Mvc.HttpPost] public HttpResponseMessage Add([FromBody]Products id) { ...
0
votes
1answer
33 views

Simple default operation with optional parameters

I'm trying to create a method that takes two strings and gets called if I provide the params or not. It's proving to be difficult for me. Here is my controller with the test method: public class ...
1
vote
1answer
116 views

ASP.Net Web API Help Page returning empty output

I have a preexisting MVC app that I added Web API and Web API Self Documentation using Nuget. While the Web API controllers function fine (return valid responses to HTTP requests) the Help controller ...
4
votes
1answer
106 views

Custom Model Binder for Decimal in Asp.Net Web API

I have a web api application using asp.net mvc web api that recieve some decimal numbers in viewmodels. I would like to create a custom model binder for decimal type and get it working for all ...
0
votes
0answers
17 views

Asp.net web api serializing generic object [duplicate]

I have a generic object used for pagination results: public class PagedResult<TEntity> { public IEnumerable<TEntity> Results { get; set; } public int PageNumber { get; set; } ...
0
votes
1answer
78 views

How to bind to detail using Bootstrap Modal Rowlink with Knockout - MVC 4

I am struggling to get my head around opening a modal form from a table generated from WebApi using Knockout. Actually, more correctly, I am struggling with home to bind the modal to the clicked row. ...
0
votes
1answer
56 views

Can I use MiniProfiler to instrument an ASP.NET MVC WebApi website?

The ASP.NET MVC website I'm working on has some (Controller-derived) "user" pages and some (ApiController-derived) "api" pages. The site uses MiniProfiler to instrument the "user" pages, and I really ...
0
votes
1answer
30 views

How create MultipartFormFormatter for ASP.NET 4.5 Web API

These links didn't help me: way 1, way 2 Example: //Model: public class Group { public int Id { get; set; } public File File { get; set; } } //Controller: [HttpPost] public void ...
3
votes
1answer
50 views

ModelState.IsValid even when it should not be?

I have API where I need to validate my user model. I choose an approach where I create different classes for Create/Edit actions to avoid mass-assignment and divide validation and actual model apart. ...
0
votes
1answer
47 views

Custom Validation Attribute for three levels deep model

Hi I have a situation in witch I have to create some custom validation attributes because the way my model is created.The model looks something like this: public class EvaluationFormDataContract { ...
1
vote
1answer
60 views

Handling bad request in asp.net web api

I have a api url like below in my mvc4 app http://localhost:15839/api/mydata/getdata/3365895543/PROBLEMDATA/myotherparam Now client is consuming the above url to send httprequest. In response api ...
0
votes
1answer
59 views

WebAPI + Azure WebSite + Client WebSite + SSL - how many certs do I need?

I have a WebAPI solution hosted in an Azure Web Site (appnameapi.azurewebsites.net) that has some endpoints exposed to regular http right now. I also have a client application hosted in a separate ...
-1
votes
0answers
56 views

WCF REST Service Vs MVC WEB API

I am not aware about MVC WEB API, so just wanted to know does it replacement of the WCF REST service? Why it comes under MVC application project template? Does it tightly coupled with MVC application? ...
1
vote
1answer
92 views

Sending one AJAX request, but receiving multiple requests on the controller side

I am sending ajax HTML DELETE request from my web site to my RESTful Web Service (Asp.NET MVC 4 Web-Api ApiController) to delete the selected data from my HTML table. I get the selected row with ...
0
votes
1answer
60 views

Handling Exceptions in MVC4 when API Controller creation fails?

I got an error on the creation of an api controller due to that I didn't set up autofac for webapi. However, I can't seem to catch the exception anywhere. <Error> <Message>An error has ...

1 2 3 4 5 20
15 30 50 per page