Are Nhibernate Helper Kits available for VS2008? - nhibernate

Can you provide some information on Nhibernate Helper Kits for VS2008 and which all are open source and which all are not. Can you also share some links that gives information on using NHibernate with ASP.NET MVC.

Not sure what you mean by helper kits.
As far as using ASP.NET MVC with NHibernate Jeffrey Palermo's blog has a lot of good information on the topic. He goes into great depth in his book ASP.Net MVC in Action. Worth the read.

Related

.NET Core and Entity Framework

I was reading through some of the microsoft .net core documentation and stumbled across this page: https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/
Does the following quoted text (more specifically the last bullet point) imply that the MVC approach is no longer the recommended approach moving forward? Is this just a microsoft thing or general for any development that was based on the MVC approach?
This tutorial teaches ASP.NET Core MVC and Entity Framework Core with
controllers and views. Razor Pages is a new alternative in ASP.NET
Core 2.0, a page-based programming model that makes building web UI
easier and more productive. We recommend the Razor Pages tutorial over
the MVC version. The Razor Pages tutorial:
Is easier to follow.
Provides more EF Core best practices.
Uses more efficient queries.
Is more current with the lastest API.
Covers more features.
Is the preferred approach for new application development.
Razor Pages are still MVC, they just greatly simplify your code. Rather than having a distinct Model in one directory, a Controller in another directory, and a View in yet another directory, it keeps everything together in two files: A "View" (.cshtml) and a "Controler/Model" (.cs).
If you look at enough ASP.NET MVC applications you quickly notice how often there is a 1:1 relationship between the Views and their Controllers. In most cases, you find the Controller contains one method per View that consists of little more than return View();. Razor Pages helps solve this issue.
This does not change the fundamental value proposition of MVC and it's clear separation of concerns. It also isn't an either/or proposition. You can absolutely mix the traditional MVC structure and Razor Pages in the same web app.

nHibernate + Mvc3 Sample Application

I'm looking for a decent codebase that demonstrates how to use nHibernate as the persistance layer in an asp.net mvc3 project.
The two key pieces of understanding that I am looking to develop are
How to deal with ISession and
ISessionFactory.
How to implement the repository pattern without leaking any details of its nHibernate implemenation.
I'm aware of Sharp Architecture and reading through that now - Its interesting but I'm more keen on finding a straight-forward web app to pick apart than another framework to learn.
Thanks in advance.
I put together a project that offers an example of how to do this using nhibernate and asp.net mvc 2. The repository and nhibernate implementations will be almost the same. Probably the biggest change will be the ioc / dependency injection piece. Take a look. It should provide a solid starting point. Here is the URL.
http://gpsnerd.codeplex.com
Let me know if you have questions.
Bob
Take a look at https://bitbucket.org/FunnelWeb/dev
FunnelWeb is a blog engine based on ASP.NET MVC and NHibernate.
It is opensource and used by many bloggers/develoeprs

What is the best practice using NHibernate 3.0 with WCF Web Services?

There seems to be quite a bit of information regarding using NHibernate and WCF Web Services but I'm struggling to find a definitive guide on how to implement the two technologies together in a efficient, thread safe way.
Specifically I want to grab the ISession object and uses that to get and save data through my existing repositories. My Business Objects, Unit Tests and ASP.NET Web Application all use the NHibernate framework and it works just great (it's my first hobby project using an ORM). My big question is how to combine this great framework with WCF Web Services.
I've read that version 3.0 NHibernate has NHibernate.Context.WcfOperationSessionContext but I'm unsure of it's implementation (see this question). From what I understand, one option is to store the ISession object in the OperationContext?
Can anyone point me in the direction of a implementation example?
Many thanks.
Here is a post describing, in detail, all the steps for registering and using the WcfOperationSessionContext. It also includes instructions for using it with the agatha-rrsl project.
WCF and Nhibernate work together in Sharp Architecture project. You can have a look at their implementation

Can you point me to current examples using NHibernate in an ASP.NET MVC2 app?

Can anyone point me to any self-contained, complete, current reference materials/projects using NHibernate in an ASP.NET MVC2 application?
I have looked at Sharp Architecture, but I am not sure I need the complexity in that project. I certainly don't know enough about it to know if it is over-engineered for my purposes.
I would like to see more types of implementations to gauge the various ways people have skinned this cat.
This video series on nHibernate is great and they are using MVC Storefront as the base for the work:
http://www.tekpub.com/production/nhibernate
Code is here:
http://github.com/robconery/Kona
Another great MVC Resource (if you need one) is their MVC Videos:
http://www.tekpub.com/production/aspmvc
and
http://www.tekpub.com/production/byob
I can't recommend them enough.
Max Schilling
Gave it to Max for just answering. :)
But, for the record, here's additional apps to consider, should you end up here:
Sharp Architecture (the Northwind app
is okay but lean, not typical
enterprisey stuff)
Who Can Help Me? (great stuff and
kept up-to-date)
FubuMVC has good sample apps (based
on MVC not MVC2 at the time of this
post)
Thanks.

Is this NHibernate sample still valid?

Or the concepts/best practices used there are now deprecated? I'm just starting to use NHibernate and I'm having a hard time finding good real life samples.
http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx
As you can see for the dates the author (Billy McCafferty) didn't update it in a long time. There is so much more on the NHibernate ground now but most of the concepts in that article still apply.
You may want to checkout additional sources like:
http://nhforge.org/
http://fabiomaulo.blogspot.com/
http://fluentnhibernate.org/
If you are using NHibernate in web applications, Billy McCafferty built an excelent framework on top of NHibernate and ASP.net MVC. http://www.sharparchitecture.net/
And this open source app is an awesome sample: http://whocanhelpme.codeplex.com/