Multiple HttpPost method in Web API controller

I am starting to use MVC4 Web API project, I have controller with multiple HttpPost methods. The Controller looks like the following: Controller public class VTRoutingController : ApiController { ...

Returning JSON with web api controller MVC

I am trying to convert a regular old controller I was using to an API controller and am having a little bit of difficulty. What these series of functions do is, in the jQuery, it iterates over a...

Get data from Web Api in C#

I am using a Web Api with the following data in a controller. public IEnumerable<string> Get() { return new string[] { "Item1", "Item2s", "Item3", "Item4", "Item5" }; ...

page Redirect in ASP.Net MVC + Web Api + AngularJs

I am building a ASP.Net MVC application that can work both in Web and JQuery mobile. So i am creating a seperate view for Web and JQuery mobile application. I have placed all my primary business...

Error: ConnectionRefused (0x274d). System.Net.Sockets.SocketException No connection could be made because the target machine

I had same issue ( link https://superuser.com/questions/394223/iis-cannot-access-folder-for-website-hosting) I hosted web api service in iis when i hosted i got internal server error i found...

Web API Authorization with ClientId and ClientSecret

Im using OWIN/Katana middleware in my web api authorization. The flow. I am issuing acess_token and refresh_token to the requesting client. The access_token has short-lived lifespan while the...

What exactly is the difference between Web API and REST API in MVC?

I have a little understanding on REST API. As per my knowledge it is used to work with HTTP services (GET, POST, PUT, DELETE). When I add a Web API controller it provides me some basic methods...

System.PlatformNotSupported exception with service stack

I am trying to run a service stack application, it works fine on my dev machine when deployed on another box, I get System.PlatformNotSupported exception. Stack trace below: Unhandled Exception:...

Return file from ASP.NET 5 Web API

My previous question: https://stackoverflow.com/questions/34853072/how-to-return-file-from-asp-net-5-web-api/34856354#34856354 I am trying to return a file as the response from Web API POST...

GDS Implementation (Sabre,Amadeus,worlspan)

We want to develop a system which will communicate to various GDS's (Sabre,Amadeus,worlspan) for the Car rentals.which will push/ pull the data from GDS, we don't have any documents as such right...

ASP.NET Core Web API exception handling

I am using ASP.NET Core for my new REST API project after using regular ASP.NET Web API for many years. I don't see any good way to handle exceptions in ASP.NET Core Web API. I tried to implement...

How to set start page in dotnet core web api?

I try to build a web application with dotnet core web api,but i do not know how to set index.html as start page which can be done with dotnet framework web api easily. And i tried to use...

.Net Core WebApi refuses connection in Docker container

I am trying out Docker with a small WebApi which I have written in dotnet core. The Api seems to work fine because when I run it with dotnet run it starts normally and is reachable on port 5000....

IDX10603: The algorithm: 'HS256' requires the SecurityKey.KeySize to be greater than '128' bits. KeySize reported: '32'. Parameter name: key.KeySize

I was just working with Asp.Net Core Web API, and implementing Authentication. And I am calling this API from an Angular Application. But I am always getting an error as below. IDX10603: The...

ASP.Net: Call an async method in Page_Load

I have this API client which has a send method used to post my object to a Web API service and return an object of type ReturnedResults. Now I need to run this post method in an ASP.net page_load...

Building SQL Server Database Project In Ubuntu

I'm building an ASP.NET Core 2.0 Web API application that is hosted in an Ubuntu environment. So far, I've had great success getting things building and running (for the .NET Core app) in...

LDAP Authentication for asp.net Web API

I'm working on WEB API project using ASP.NET technology. This Web API need to check the user from AD Active Directory, as domain authentication using LDAP:// [HttpGet] public...

Web API method with FromUri attribute is not working in Postman

I have written the below simple Web API method. [HttpGet] [HttpPost] public int SumNumbers([FromUri]Numbers calc, [FromUri]Operation op) { int result = op.Add ? calc.First...

Create WSDL for an ASP.Net Core ApiController

I am creating a service using ASP.Net Core. The service is based on the ApiController. [ApiController] public class XmlALaCarteServiceController : ControllerBase { private...

How to implement a .NET WebAPI with a route of "controller?action&parameters"?

I'm trying to implement a specific HTTP interface (SAP Content Server HTTP Interface) with .NET Standard WebAPI, that requires that the routes be all in the form...

Token not authenticating with OpenIdDict/Connect

I am currently working on converting an existing application consisting of an Angular 9 frontend talking to Asp.Net MVC/Web API/Identity backend. I am converting the .Net to .Net Core 2.2. The...

Tracking hangfire background jobs with app insights

I have set up app insights in Asp.net core application. All my web api requests are tracked on app insights and if I have any failures I can simply find them in Failures section. However, I have...

CORS not working for calls from Ajax to ASP.NET Core Web API

It throws this error on the Ajax call. I also tried these lines in Startup.cs with named policy. None of the ways that I found online, works. I'm sure I'm making some silly mistake somewhere, I'm...

How to return nested tables (one-to-many) in .NET Core WebAPI using Entity Framework Core?

I am new to .NET and having trouble figuring out why Im getting certain results. I found some results on eager vs lazy loading but none of the solutions have worked. I have changed the names of...

Failed to compute cache key: ".csproj" not found

I am new to Docker. I created a Web API using ASP.Net Core using Visual Studio 2019 as well as in VS Code. It works fine. Then I added docker support and added Dockerfile with default values. When...

Run Vue/vitejs and ASP.net core web API on same server

In school we have a project where we are working with vite/vuejs as frontend and using ASP.NET core web API as the rest/backend. I work on the backend/rest-api in visual studio and the frontend...

create an API with .NET Minimal APIs that require session api key

This video is really nice and shows how to create Minimal APIs using .net 6: https://www.youtube.com/watch?v=eRJFNGIsJEo It is amazing how it uses dependency injection to get mostly everything...

how to create a generic treeview component in blazor?

could you help me? I want to make a generic tree view component in blazor webassembly but I am a bit lost in how to do it, I want to be able to pass any type of object list to the component, for...

What is the difference between static class and singleton in .net mvc project?

I understand difference between static class and singleton, importantly that singleton can be instantiated once where as static class doesn't need an instance. This question is with the...

How to have the same response format for 400 response raised from BadRequest and validations?

I have a DTO which is an input param for the API's POST endpoint. The DTO has got data annotations and validation happens automatically. Following is an example: { "type":...