How to Implement OWIN and Katana in MVC 5Application - asp.net-mvc

i upgrade my application from mvc4 to mvc5. i am using Entity Framework code first approach in my application. i am confuse about OWIN and Katana. how i implement these concept in my web mvc5 application. please guide me.
Thank you

ASP.NET MVC was not designed to work with OWIN. It's the ASP.NET Web API and SignalR that were built for OWIN and provide specific host. So you cannot implement those concepts in an ASP.NET MVC application.

So far the only MVC framweworks I have found that support OWIN are NancyFx or FubuMVC.

Related

Silverlight/RIA Services and ASP .NET MVC/WebAPI

I did some research around but I have some doubts still about following topic...
I have Silverlight/RIA Services project that needs to have ASP.NET MVC look as well as WebAPI for some different clients.
So my question is following
Can we use somehow RIA Services with ASP.NET MVC 5?
And if not what is a painless way to represent all existing logic in ASP.NET MVC?
Thank you!
Ria services have nothing to do with look and feel.
A Silverlight app or a non plugin, which uses RIA services can be hosted in a web page created using ASP.Net.
Can we use somehow RIA Services with ASP.NET MVC 5?
Yes.
RIA services which could be used by an asp.net backend would not gain the benefit of RIA services because changes made in the backend end are not generated forward to an application such as a Silverlight plugin. It just becomes another way of accessing data.

ASP.NET MVC and AngularJS authorization

I am currently at the beginning process of starting a new application and am quite new to MVC and Angular. So far i have created a custom authorize attribute using asp.net MVC, this enables me to use the [Authorize] tag. Is it possible to use with an AngularJS front-end?
Any resources that will point me in the right directions would be appreciated.
AngularJs is really good for single-page-applicaitons (SPA). So just separate your front-end and back-end layers. Use Angular to implement all the views and front-end stuff. Use ASP.NET WebAPI to expose REST API for front-end (and maybe mobile) app.
A few useful links:
Angular Routing module
ASP.NET WebAPI Bearer token authorization with AngularJs
Routing in SPA with AngularJs
The answer is YES! So you can still benefit from ASP.NET MVC features like authentication and authorization etc. and still use AngularJS on the client.
I actually had the same question and after a bit of research I discovered the following.
It's true we should embrace SPAs (single page apps) but at the same time we should not just discard mature server-side frameworks such ASP.NET MVC. You can simply have a hybrid web app or mini SPA as we also call them. These web applications use normal ASP.NET MVC routing to show views and then, once the view loads you can leave all the responsabilities to AngularJS. Miguel Castro uses the term SPA silos. Plus you can benefit from AngularJS' routing as well. Miguel Castro also explains how to use them both together to get the best of server and client side. I really suggest seeing his presentation (link below).
In that way you can still benefit from ASP.NET MVC great features like Authentication, Authorization and others but still have AngularJS run your views.
I got this answer on the following locations that you definitely should check out:
Miguel Castro: AngularJS for ASP.NET MVC Developers
PluralSight - Cooper, Eames: AngularJS for .NET Developers
StackOverflow: Mixing Angular and ASP.NET MVC/Web api?
StackOverflow: ASP.NET MVC and Angular JS tipping point

Custom oAuth client in ASP.NET MVC 5

I am confused about how to build the custom oauth client in asp.net mvc 5.
In mvc 4 it was a simple operation. Implementing custom class from IAuthenticationClient. And then in AuthConfig.cs call the function OAuthWebSecurity.RegisterClient. But how it can be done in mvc 5?
Mvc5 authentication is built on Katana (OWIN components by Microsoft). Check following article for detailed overview of Authentication changes in MVC5.
https://www.simple-talk.com/dotnet/.net-framework/creating-custom-oauth-middleware-for-mvc-5

database connectivity using nhibernate for an asp.net mvc application

how to connect database(oracle) using nhibernate for an asp.net mvc application?
can anyone help..
You could try:
http://nhbwithoracle.blogspot.com/
Nothing special has to be done for asp.net mvc integration.

setting up Fluent NHibernate with asp.net mvc

I am in search of a tutorial which leads through the setup of Fluent Nhibernate in an asp.net mvc web application... Any good tutorial....
Have a look at http://www.fluentnhibernate.org/ their official site. :)

Resources