Unity Dependency Resolver not working with my Web Api
Hello,I just created a web API and I'm using Unity as my dependency injection resolver. It's not working.I had it working at one point, then it stopped working, then it started working again (not sure...
View ArticleHow to make sure the user is logged into only one browser or one device at a...
I have a solution that usesMVC Web API Web Forms And I need to make sure that when the user is logged into one browser they cannot log into another browser or some other device.I have so many pages to...
View ArticleWhy My test project can't get the data from the real project?
Question Key work: C# Web Api TDD EF6project: Web Api Platform: Visual Studio 2015Technology: C# , TDD, EF6Problem:I run my project in Debug mode and visit web in IE, and then I am pretty sure about...
View ArticleASP.NET Web API - Will there be a performance impact in using...
I had to catch the errors that occur during XML serialization (mostly due to invalid ASCII control codes), so I went on and replaced the controller endpoint as below.Found the solution on how to do...
View Articleodata web api using EF
Hello,I am pretty new to web api, EF and odata. We are using oracle and want to use RAW sql to build out a model but allow for the odata querying options without having to translate and dynamically...
View ArticleWeb API 2 Service - how to set constraints on parameters in WebApiConfig
So I have set up the following route in my WebApiConfig file. It works fine if I take out the line with the constraints. It also fails if I simply the constraints line to: constraints:=New With {Key...
View ArticleHow to return error message when model object expected?
So I have created a GetValues function in my controller to return the instance of a demoModel which is a complex model class. This works fine when returning a succesfull populated instance of the...
View ArticleTrying to integrate Unity Dependency Resolver into web API
Hello,I have a web API and I'm trying to implement dependency injection with unity. I'm using this guide to setup Unity:http://www.asp.net/web-api/overview/advanced/dependency-injectionBut it doesn't...
View ArticleThe remote server returned an error: (401) Unauthorized. ( WEB API & WEB APP...
I have WEB API & Web application both running on same server. I have enabled both for windows authentication. Web Application is consuming WEB APIcode : public static List<Course>...
View Articlelooking for web api and angular based small project with angular v1.x
i am looking for asp.net mvc and angular based small project with angular v1.x which i can download and run from my IDE to learning purpose. if anyone know the links then please share with me.thanks
View ArticleWebApi2 - Retrieve ErrorMessage From DataAnnotations
I want to return the custom error message that I have specified in my data model class to return to user. I've tried creating a filter for override OnActionExecuting(HttpActionContext) but I am still...
View ArticleHelp neeed in authentication
Hi,I have created the Web API using OAuth 1.0 with bearer type authentication and my API is on live now. my requirement is there any way that i can migrate from Oauth 1.0 to OAuth 2.0without breaking...
View ArticleASP NET Web API Associations
I Need assistance, I'm new in web api development. I managed to build my 1st web api & deployed it successfully, but i need help with relationships (Associations). I have to models Company and its...
View ArticleVB.NET my string message is not being returned from Badrequest("my message")...
So looking at the linereturn BadRequest("Return invalid data message to caller") One would expect the message "Return invalid data message to caller" to be displayed back to the user. Instead all I see...
View ArticleCannot get verbose error messages
I have a REST service I've put together that runs fine locally but not when hosted.When I send a request to the hosted service I get this response in Postman:{"Message": "Object reference not set to an...
View ArticleCustomer object as parameter for Put method.
Hi ,I have the following methods in my webapi project:Controller A: public HttpResponseMessage Post([FromBody] CustomClass1 body){}public HttpResponseMessage Put([FromBody] CustomClass2 body){}public...
View Article401 (Unauthorized) or CORS issue
I am trying to access a service that is on a different domain. I own both so any additional configuration is possible.I am calling the service method via jquery, ajax. At the moment i have 401...
View ArticleCalling Long Running Web Service from Web Api
Hello everyone and thanks for your help in advance. I have a WebApi that is called from a web page that inserts data into a SQL table. I now need to add a process that contacts an outside web service...
View ArticleCreate a custom REST Service using ASP.NET Web API
How to create a custom REST Service using ASP.NET Web API ?i want to use this as a middleware/businesslogic layer which in turn consumed by a web part within SharePoint. and the methods inside the web...
View ArticleGetting Owin Authorization token with AJAX
Hello,I'm working on a web API and I'm trying to implement an Owin Authorization token.I've got this in the backend:public class SimpleAuthorizationServerProvider : OAuthAuthorizationServerProvider {...
View Article