0
votes
0answers
23 views

Ninject WebApi Issue within MVC App

I currently have a working MVC 5 application which uses Ninject for dependency injection. I am now taksed with adding some Web API controllers to this project, and I want to use dependency injection ...
0
votes
2answers
31 views

WebAPI not serializing inherited class on POST?

Here is my controller method: [System.Web.Http.HttpPost] [System.Web.Http.Route("api/exercise")] public HttpResponseMessage CreateExercise(ExerciseDto exercise) { Here are my classes: ...
0
votes
2answers
18 views

Can't access local to Web Api from AngularJS

I've build Web Api and inside the project included a web site built with AngularJS. When I start the project it points to my web site and opens it. In AngularJS controllers I call methods from the web ...
-1
votes
0answers
39 views

two way communication in .net C# mvc

I have to create one webapi so that that can be accessed from any where. Second thing that is to be developed is web site which contains reference of above web api. Third thing is to develop is ...
0
votes
2answers
21 views

Binding values to HTML dropdownlist using JQuery with ASP.NET MVC WebAPI - Cannot read property '0' of undefined

I am trying to populate values for html drowpdown using JQuery from webapi url. JSON returns value and I've verified it using alert function. But, when I bind those into dropdown it is not populating ...
0
votes
1answer
38 views

Exposing EF6 model subsets via WebAPI

For example, I have a EF6 model like this: class User { public int Id { get; set; } public string Email { get; set; } public string Name { get; set; } public virtual ...
0
votes
1answer
51 views

Linq Contains show all the results in Asp.net Wep api

I got some issues in Asp.net Web Api. here is my Linq statement and used it for autocomplete. (from usr in UserProfile where usr.MobileNo.Contains('973') select usr).ToList(); Inside my UserProfile ...
0
votes
2answers
19 views

Why call ASP.NET WebAPI package libraries with version 5.1.0 as ASP.NET WebAPI 2.1?

I want to get started with ASP.NET MVC and WebAPI that was released in Jan 2014. ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1 (Ref: NuGet) I created a new ASP.NET Web application ...
0
votes
1answer
19 views

How can I handle exceptions in WebAPI 2. methods?

In my WebAPI 2.1 application I am processing inserts like this: [Route("Post")] public async Task<IHttpActionResult> Post([FromBody]City city) { if (!ModelState.IsValid) ...
0
votes
0answers
18 views

Add additional parameter to Kendo Grid web api request [duplicate]

I am using Kendo UI MVC Grid with Web API controller. I got the source code for a sample project here Partial view of code in my cshtml page is: .DataSource(dataSource => dataSource ...
0
votes
0answers
23 views

WebAPI 2 Authorize attribute failing every time on EF controller

I'm about at my wit's end with authorization in WebAPI (at work, we have a simpler scheme). I created a project using the Single Page Application template using Entity Framework. My database is an ...
0
votes
2answers
26 views

ASP.NET Web API ModelState do not contains all parameters, validation do not work

I'm using ASP.NET Web API and I have this POST method in controller: [Route("Order/{siteId}/{orderId}")] public HttpResponseMessage Post(long siteId, long orderId, OrderInformation orderInfo) { ...
0
votes
0answers
21 views

WebAPI Custom ControllerBuilder Not Being Called

I've got a custom controller buildre defined in my WebAPI solution and I've just updated to the latest version of MVC and it appears that this controller builder is no longer being called thus all my ...
0
votes
0answers
30 views

Updating MVC4 & WebAPI to MVC5 & WebAPI 2 Broken MEF Implementation

I've just updated my MVC4 app to MVC5 and for some reason this appears to have completely broken my MEF implementation at the same time. The code snippets below from my solutions have been running ...
0
votes
1answer
38 views

WebAPI- How to implement layers?

This is my simple customer controller in Web API. public class CustomerController : ApiController { BusinessLayer.ICustomerRepositary CustomerRepositary; public CustomerDTO Get() { ...
1
vote
2answers
43 views

Manually validating ASP.NET Identity user account

I have this ASP.NET MVC 5 site which uses ASP.NET Identity (pre 2.0), the site comes with a WebAPI. I have a Windows Phone app which will consume services from this site, for which I want to validate ...
0
votes
0answers
24 views

MVC5 when to refresh token from api

I have ASP.Web Api 2 that has authentication through Bearer Token, I added to it Refresh Token. I'm new to this so I have some confusion and questions, my MVC5 App is using as Web UI (View), all ...
2
votes
2answers
31 views

WebApi Help Page Description

What populates the Webapi method's description on the helper page and the introduction paragraph?
0
votes
0answers
10 views

return nhibernate entity from web api?

Is it a good idea to return nHibernate Entity from WebApi? For simple entity I tried to use this but what about complex entities. How will lazy loading be handled in that case?
0
votes
0answers
30 views

Include CMS in .Net MVC project

We are looking for creating a .net MVC web platform that should get some content from a CMS. We would like to work with Content API, or any other CMS. The most important is that the CMS only should ...
0
votes
1answer
60 views

WebApi - Make sure that the controller has a parameterless public constructor

I have followed this tutorial which has worked great, until i modified my DbContext to have an additional constructor. I am now having issues with the resolution and not sure what to do to fix this. ...
0
votes
0answers
22 views

Self-documenting WebAPI 2

I have an ASP.NET MVC 5.1 WebAPI 2 with attribute routing project I would like to document. The idea is to add a "describe" path/controller to each API that would create a list of "description" ...
0
votes
0answers
28 views

Make Web api 2 to use mvc 5 credentials

I have a MVC 5 application and I can register a user. Now, I want to access a Web Api 2 with these credentials. I added Web api 2 just like in this thread And this is my api public class ...
0
votes
1answer
19 views

Get cookies from AuthorizeAttribute Filter

Using ASP.Net Web API 2, is it possible to get cookies from the AuthorizeAttribute filter public class SessionFilter : AuthorizeAttribute { public override void ...
0
votes
1answer
43 views

How many threads are involved in servicing a ASP.NET Web-API HTTP request?

I thought to log Thread-ID for the purpose of tracking a request and make the log file readable. So, my initial attempts were logging in Global.asax like this: protected void ...
0
votes
2answers
93 views

Migrating to the WebApi 2.2 RC and getting Response Status 406 (not acceptable)

I migrated to the WebAPI 2.2 RC (Microsoft.AspNet.WebApi -Version 5.2.0-rc) and I since them I get only 406 (Not Acceptable) as status response on all my queries, for example: ...
5
votes
0answers
58 views

ADFS 2.0 Windows 2008 R2 Web API

I would like to make a MVC Web Application that talks to a Web API application and use ADFS 2.0 (on Windows 2008 R2) for authentication. I managed to make the MVC Web Application to authenticate ...
0
votes
0answers
26 views

Consuming secured WebAPI from Windows Phone 8

I have this ASP.NET MVC 5 site, which uses ASP.NET Identity as the security framework (Forms Authentication, if I understand correctly). I need to expose its functionalities using WebAPI, I want this ...
0
votes
1answer
30 views

asp.net datetime serialization returns different values on different servers

I'm retrieving a datetime from a shared database. More precisely I'm retrieving a timespan and converting it to a datetime via Convert.ToDateTime(timespan.ToString()). I have two servers which ...
1
vote
1answer
52 views

How do I host a web application and an API from the same server while keeping them in separate?

Let's say we have 2 separate applications, a Web Api application and a MVC application both written in .NET 4.5. If you were to host the MVC application in IIS under the host header ...
1
vote
0answers
37 views

AJAX DELETE not working with WebAPI - sends OPTIONS for cross-domain request

My AJAX request: var options = { url: 'localhost:different/api/exercise/1', type: 'DELETE', dataType: 'json', xhrFields: { ...
1
vote
1answer
36 views

User SELECT extremely slow in .NET MVC with SimpleMembershipProvider

I built a .NET MVC4 / Webapi2 app which uses SimpleMembershipProvider for authentification. Since yersterday, all the app is extremely slow, so I monitored it with NewRelic. The database uses up 95% ...
3
votes
1answer
66 views

Secure 2 different web applications with one identify service

Secure 2 different web applications with one identify service Identity Service: Thinktecture Identity Service V2 Application 1: Asp.net MVC 5 application Application 2: Asp.net Web API application ...
2
votes
0answers
40 views

Deserialize Nested XML with Web Api MVC 4

I have the following XML which I am attempting to deserialize to an order object with MVC 4 Web Api with .Net Framework 4.5... but when I send this XML using POST from Chrome Advanced Rest Client with ...
-1
votes
0answers
27 views

Using WebApi with MVC how to get files

Here is my situation. I will have a drive on the Server where i am going to creating multiple files which will be taken by another service which will read the file and create a summarised file in ...
0
votes
0answers
43 views

Uploading File from Android to a .Net Web API using Android Asynchronous Http Client Library

I'm trying to upload an image to a ASP.NET RESTful Web API from an Android client. To accomplish this, I'm using the Android Asynchronous Http Library. I'm expecting a header to look like the one ...
0
votes
0answers
20 views

routing behavior in project with both MVC 5 and WebApi 2

When I create a web application project with both MVC 5 and WebApi enabled, routing works fine. I can get to the MVC pages, and make the WebApi calls without issue. However, if I swap the order that ...
0
votes
1answer
31 views

How to find mapping of OData edm model type to clr type?

My data layer doesn't expose IQueryable. Still I want to be able to sort data. My API has such capability but I need to identify what needs to be sorted. Say I configured the model, e.g.: ...
0
votes
1answer
53 views

How to test post method in fiddler?

I am trying to call the following POST method [http://localhost:45361/api/test], in Fiddler, with [Request Header] tab, having [User-Agent: Fiddler, Content-Type: application/json; charset=utf-8] and ...
0
votes
1answer
24 views

Web API project template in VS

Why can't we create WebAPI project directly just like "WCF Service Application" template in VS.I want to create separate solution not using MVC or ASP.Net WebForms template. In our project we intend ...
2
votes
0answers
66 views

MVC Web API Binding Model to a Derived Class

I am looking at how to bind a model to a derived class within MVC Web API, the issue I have is that I think I have found about 5 ways of doing it... What I have is: Models -> ModelBase ModelA : ...
1
vote
1answer
29 views

How should I send params to a Asp.Net WebAPI 2.1 data query method?

I have been coding like this. Sometimes there are one, two, three or more parameters: $http({ url: '/api/Topic/Retrieve', method: "GET", params: { subjectId: sub } }) The result ...
0
votes
2answers
21 views

Why is my simple RoutePrefix failing with Web API?

I have the following: [RoutePrefix("api/UserProfile/{id}")] public class UserProfileController : ApiController { private IdentityContext db = new IdentityContext(); public ...
2
votes
1answer
73 views

How can I combine multiple same functionality classes (controllers) into one that takes a data object as a parameter?

I have coded methods looking like this: var result = await db.TaskStatuses .Select(e => new { Id = e.TaskStatusId, Name = e.Name }) .ToListAsync(); and var ...
0
votes
1answer
23 views

How do I set up attribute routing for a PUT with web-api?

I am trying to set up attribute routing: [HttpPut] [Route("api/Config/Put")] [ResponseType(typeof(void))] public async Task<IHttpActionResult> Put(Config config) { if (!ModelState.IsValid) { ...
1
vote
0answers
35 views

Scalability for web application using an incomplete 3-Tiers architecture

Firstly, let me explain about my understand about what is called as an "incomplete 3-tiers web application architecture", it's an 3-layers architecture involves: 1.Presentation layer: ASP.NET MVC web ...
1
vote
2answers
30 views

How to bind a request model in WebAPI GET request with route attribute?

GET :http://www.Example.com/Api/1/0/Book/Company/0 [Route("{UserId}/{Category}/books/{BookType}/{Page}")] [HttpGet] [RequestAuthorization] public Response Get(int ...
1
vote
1answer
36 views

WebSecurity.CurrentUserId = -1

Im developing an android app that should login/register and read some data from database. I have WebApi login controller. and this is my problem [HttpPost] public HttpResponseMessage Post(Login ...
1
vote
0answers
48 views

web api 2 file upload error

I'm using this code to process a file upload to a web api: [HttpPost] public async Task<IHttpActionResult> Post(string provider) { if (!Request.Content.IsMimeMultipartContent()) ...
0
votes
0answers
11 views

CORS header origin move to application configuration file in .net

[EnableCors(origins: "www.example.com", headers: "*", methods: "*")] public class DataCaptureController : ApiController { /// <summary> /// Instance of Noise And Acceleration Data ...