How to use Web API 2 with MVC4 - asp.net-web-api

I am looking for some solutions, is there any way to use web API 2 with MVC 4 I am working on MVC4 but i want to use Web API 2 in my application.

Related

SSO for .net core 3.1 web api

We would like to achieve SSO(Google, Microsoft, Twitter, Facebook) for a .net core 3.1 web api (console api controllers) application. I have gone through few links that achieves this with the help of MVC or angular front end and IdentityServer4. Our application is purely an web api. Can some one guide me with sample code or link to achieve this? How does SignInWithGoogle/FB/Twitter/Microsoft button and its click will be handled?

How to login to ASP.NET Core MVC application from Web API?

I have an Angular 5 application which uses a REST API for its back-end process. And other is pure ASP.NET Core MVC application.
Both have their own AccountController. I have to make an integration in a way that the Angular application has to call the ASP.NET MVC application. When it calls the ASP.NET MVC application, it has to login to that application and returns the Razor page. From this point, user will access the ASP.NET MVC application.
Both the applications have their own databases. But the user details will be stored in both applications.
My question is, how to achieve this?
If any article or documentation is available, it would be helpful if you share it.

obtaining OAuth2.0 token using asp.net mvc core

OAuth 2.0 Web applications (ASP.NET MVC) describes getting oauth2.0 token using asp.net mvc application, but in asp.net mvc core application, controller is of type Microsoft.AspNetCore.Mvc.Controller while AuthorizationCodeMvcApp method expects System.Mvc.Controller object.
var result = await new AuthorizationCodeMvcApp(this, new AppFlowMetadata()).
AuthorizeAsync(cancellationToken);
Is there a different way to obtain OAuth2.0 token in asp.net mvc core? I tried casting core mvc controller, but no luck.
thank you in advance for your help

What replaced HttpOperationHandler in WCF Web API to ASP.NET Web API

In upgrading an old project that was built using WCF Web API to now use ASP.NET Web API, I have run into a few classes that implement HttpOperationHandler<HttpRequestMessage, T>. I'm unable to find an equivalent class in the new assemblies. Does something similar exist or will I need a different approach?
The concept of Operation handlers has been replaced with Filters and model binders.
Here are some links that you might find useful:
How to Migrate from WCF Web API to ASP.NET Web API
Mike's blog on How WebAPI does Parameter Binding
Getting started tutorials on ASP.NET WebAPI page.
Hope this helps.

Should I create ASP.net web app or ASP.net MVC with ServiceStack?

I have a working ServiceStack application which started off part of my MVC application which contains my Jquery Mobile web site.
The services are growing and I am thinking about moving the ServiceStack code to separate app but not sure whether I should host service stack in an Asp.net web application or in a MVC application.
Are there any benefits down the road if I go one way or the other? In the future I need to introduce authentication for the services, would that be a factor in deciding?
I would host it on an vanilla ASP.NET host, since it's a more barebones web host than MVC which adds additional (and un-necessary) HTTP Modules and overhead.

Resources