ASP.NET Web API return queryable DTOs?
I built a nice little API with the ASP.NET Web API, but I guess it’s not right to return the entities from my context (entity framework) AsQueryable, so I’m mapping everything to DTO objects.
I built a nice little API with the ASP.NET Web API, but I guess it’s not right to return the entities from my context (entity framework) AsQueryable, so I’m mapping everything to DTO objects.
I have a pre-action web api hook that will check ModelState.IsValid. If the ModelState is not valid I do not want to execute the action and just return my message immediately. How exactly do I do this?
I have an ASP.NET Web API web service which throws a SerializationException in certain circumstances. The problem is that I’m unable to trap and log this exception server-side — the only place it shows up is in the body of the HTTP response to the client.
In ASP.Net / ASP.Net Core WebAPI,
This problem is affecting my ASP.Net WebApi Patch method which looks a lot like this:
I have Microsoft Visual Studio Express 2013 for Web, Version 12.0.30501.00 Update 2. I have a solution with 2 project in it, one is a web api, and the second is an MVC project intended for for the views. I have create a simple web api returning httpresponsemessage and I can go in fiddler and I will see the json response. However in my second project when attempting to call through ajax I received a cross domain error.
There seems to be some weird behavior in ASP.NET Web API (4.0.30506) that I haven’t witnessed before.
i´m trying to use the asp.net web api in WEB FORMS with visual studio 2010 (sp1)
i have done this steps http://myrandomykien.blogspot.com/2012/02/simplest-web-api-site-with-nuget.html
I have a class called ‘User’ and a property ‘Name’
my web api like