• nbolt
  • [ 5.0 , 1 ]
login to rate this
.NET BlogEngine 4.0 [non-official]
0 0
  • nbolt
  • [ 5.0 , 1 ]
login to rate this
[.NET7] Design Patterns: Facade in a Web Application
5 0
  • nbolt
  • [ 5.0 , 1 ]
login to rate this
[.NET7] Design Patterns: Repository in a Web Application
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
[.NET7] IP GeoLocation with Dependency Injection and Custom Middleware
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
[.NET7] Weather Forecast with Dependency Injection and Custom Middleware
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
2 ways for creating QR Code using ASP.NET
0 0
  • nbolt
  • [ 5.0 , 1 ]
login to rate this
AMD Ryzen 9 home server with Fedora 41 and .NET 8
17 1
  • ☺️ 1
    ❤️ 2
    🤩 1
    🫠 1
    😁 3
    😅 2
    😆 2
    😉 1
    😊 1
    😗 1
    😘 1
    😚 1
    🙂 1
    🙃 1
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
ASP.NET MVC Routing with @
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
ASP.NET MVC Routing with Constraints
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
BlogEngine.NET 3.3.5 with a BBQ Sauce
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
BlogEngine.NET 3.3.5 with a BBQ Sauce: Part 2
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
EF7 on .NET Core 7 (Preview): Fedora 35 x Windows 11 (41 Million Rows)
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Entity Framework Core 6: Fedora 35 x Windows 11 (41 Million Rows)
0 0
  • nbolt
  • [ 5.0 , 1 ]
login to rate this
Entity Framework Core 7 (Preview): Fedora 35 x Windows 11 (41 Million Rows)
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Entity Framework Providers for the .NET BlogEngine
0 0
  • nbolt
  • [ 5.0 , 1 ]
login to rate this
Enum as String in EF Core
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Facebook: Data Deletion Callback URL in C#
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
How to fix the Could not load file or assembly 'System.IO.Compression' or one of its dependencies exception
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
How to Recover Access to your Account in an ASP.NET Application using the Membership (without decrypting your password)
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Installing and Configuring Jenkins with GIT to Build and Deploy Your .NET Application
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Installing and Configuring Jenkins with SVN to Build and Deploy Your .NET Application
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
IP GeoLocation with Unity and Dependency Injection
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
NHibernate Providers for the .NET BlogEngine
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
No mercy for the ORMs: Load and Performance Test on EF Core, NHibernate and pure ADO.NET (41M rows)
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Resizing images on a Controller Method in ASP.NET Core (.NET 6)
0 0
  • 🔥 1
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Streaming Video Files in ASP.NET MVC
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Testing your MVC App on XSP/mono in Fedora (before deploying to Apache)
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Weather with Unity and Dependency Injection
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
NHibernate Providers for the .NET BlogEngine
0 0

Hi Folks! In this post I am going to talk about the NHibernate providers for the .NET BlogEngine I built a few days ago. My goal is to publish a stable version of it as a NuGet Package soon.

The code base comes from the official 3.3.5.0 version

Link to the GitHub and branch here

What is inside?

First thing you should know is that there's a separate assembly called BlogEngine.Core.NHibernate. So whenever the official source-code changes, I can easily merge and keep everything consistent. The new assembly then uses Entity Framework as the ORM.

Next thing is the POCO classes under BlogEngine.Core.NHibernate.Models namespace: although the official version contains models designed for the Repository feature, they were not specifically designed for ORM. So I had to create them representing each of the database tables. 

The third thing is the Hub class and the Fluent NHibernate Mapping classes. Because the new models act as a separate layer between the database tables and the business classes (BlogEngine.Core.Post, BlogEngine.Core.Page, BlogEngine.Core.Blog, etc.), the Hub class must convert them back and forth, whenever it needs to save or retrieve information.

Some classes contain internal objects, so I used reflection to access them.

I needed to add the FluentNHibernate, instead of using the HBM files and created a separate Mapping namespace with the classes and their database definition.

Last, but not least, the providers themselves under the BlogEngine.Core.NHibernate.Providers namespace:

  • the NhBlogProvider, saving/deleting/retrieving blog information
  • the NhMembershipProvider, taking care of user information and authentication
  • and the NhRoleProvider, taking care of user authorization

How to install the files manually

The NHibernate ORM was originally designed to work with Java and was later ported to the .NET world, so there's no need to download separate ADO.NET providers from vendors, since the ORM is self-suficient in that matter.

Make sure you are running at least the 3.3.5.0 version of the .NET BlogEngine (otherwise the providers might not work)

Make sure you have the right database tables in your server

  1. Compile the source-code and copy the BlogEngine.Core.NHibernate and the NHibernate files (NHibernate, FluentNhibernate and Iesi collections) into the bin directory of your website running the .NET BlogEngine
  2. Edit the Web.config and create a connectionstring for your database called BlogEngine, but don't forget to specify the provider name or EF won't be able to connect with the database
  3. Edit the Web.config, adding the 3 providers and setting them as default (or use only the Nhibernate blog provider, if you prefer)

The easiest way to understand how the providers work is to download the source code and run the website. First, you need to create a MySQL database and configure the connectionstring (there are database scripts inside the setup website dir). Well, and this is pretty much it!

Hope you guys enjoyed it. See ya!

what to see next
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Entity Framework Providers for the .NET BlogEngine
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
BlogEngine.NET 3.3.5 with a BBQ Sauce: Part 2
0 0
  • nbolt
  • [ 0.0 , 0 ]
login to rate this
Entity Framework Core 6: Fedora 35 x Windows 11 (41 Million Rows)
0 0
comment section
place your comment here, but login first
be the first to comment
An error has occurred . This application may no longer respond until reloaded . An unhandled exception has occurred . See browser dev tools for details . Reload 🗙