Read Only Session

One of the main new features in MicroLite 3.0 is the Read Only Session. This allows you to have access to your database in a read only manner. A new interface IReadOnlySession has been introduced and the query portion of the ISession interface moved to it (ISession extends IReadOnlySession so it still looks the same as you are used to in earlier versions of MicroLite).

The Session interfaces now look like this:

MicroLite 3 Session Interfaces

The ISessionFactory has been updated and now has an additional method to open a read only session:

MicroLite 3 Session Factory

As you can see, Fetch, Paged, Projection and Single are all exposed under IReadOnlySession while Delete, Insert and Update are only available under ISession.

If you use the ASP.NET MVC or ASP.NET WebApi extensions, there are MicroLiteReadOnlyController/MicroLiteReadOnlyApiController available in addition to the standard MicroLiteController/MicroLiteApiController.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s