NOTE!

The content in this page is obsolete and applies to a previous version of the Commons Library Provider Set. There have been some major changes recently and I have not had a chance to update this page based on that. So there.

Commons Library: Provider Set


This provider set compliments my commons library and includes certain implementations of interfaces in the commons library. These "providers" can be included and consumed by any application that uses the commons library via MEF and the commons library configuration mechanism. You can get each individual provider as a NuGet package. To use a provider, simply install it and make sure that it is in the runtime MEF search path of your application (i.e. the same location as the entry or executing assembly, or the location defined by the configuration key ak.commons.composition.modulesdirectories). Beyond that, each provider may need certain configuration settings to be defined - those are outlined in the sections below.
Data Access: Fluent NHibernate
The library is available in Nuget as AK.Commons.Providers.DataAccess.FluentNHibernate. You can use the Package Manager Console in Visual Studio and run Install-Package AK.Commons.Providers.DataAccess.FluentNHibernate.

This uses Fluent NHibernate as the unit-of-work factory provider. To configure:

<setting name="ak.commons.dataaccess.uowfactory.factoryName.provider"
 type="System.String" value="FluentNHibernate" />
<setting name="ak.commons.dataaccess.uowfactory.factoryName.connection.provider"
 type="System.String" value="..." />
<setting name="ak.commons.dataaccess.uowfactory.factoryName.connection.driver_class"
 type="System.String" value="..." />
<setting name="ak.commons.dataaccess.uowfactory.factoryName.connection.connection_string"
 type="System.String" value="..." />
... and other NHibernate settings ...
The following settings are currently supported:
  • connection.provider
  • connection.driver_class
  • connection.connection_string
  • show_sql
  • generate_statistics
  • dialect
  • current_session_context_class
  • use_outer_join
  • adonet.batch_size
  • query.substitutions
Data Access: MongoDB
The library is available in Nuget as AK.Commons.Providers.DataAccess.MongoDb. You can use the Package Manager Console in Visual Studio and run Install-Package AK.Commons.Providers.DataAccess.MongoDb.

This uses MongoDB as the unit-of-work factory provider. To configure:

<setting name="ak.commons.dataaccess.uowfactory.factoryName.provider"
 type="System.String" value="MongoDB" />
<setting name="ak.commons.dataaccess.uowfactory.factoryName.connectionstring"
 type="System.String" value="..." />
<setting name="ak.commons.dataaccess.uowfactory.factoryName.database"
 type="System.String" value="..." />
Windows Azure Providers
The library is available in Nuget as AK.Commons.Providers.Azure. You can use the Package Manager Console in Visual Studio and run Install-Package AK.Commons.Providers.Azure.

This includes a logging provider based on Windows Azure Table Storage and a configuration store based on Windows Azure Blob Storage.

To configure the Windows Azure Table Storage logging provider:
<setting name="ak.commons.providers.azure.logging.tablestorageloggingprovider.url" type="System.String" value="storage url" />
<setting name="ak.commons.providers.azure.logging.tablestorageloggingprovider.accountname" type="System.String" value="azure account name" />
<setting name="ak.commons.providers.azure.logging.tablestorageloggingprovider.accesskey" type="System.String" value="azure access key" />
<setting name="ak.commons.providers.azure.logging.tablestorageloggingprovider.tablename" type="System.String" value="table name" />
<setting name="ak.commons.providers.azure.logging.tablestorageloggingprovider.partitionkeypropertyname" type="System.String" value="partition key property name" />

The partition key property name can be one of: ApplicationName, TimeStamp, LogLevel, CallingMethod or Message.

The Blob Storage configuration store has similar properties.
Web Bundling: Microsoft
The library is available in Nuget as AK.Commons.Providers.Web.Bundling.Microsoft. You can use the Package Manager Console in Visual Studio and run Install-Package AK.Commons.Providers.Web.Bundling.Microsoft.

This uses Microsoft's bundling library for web resources bundling. Currently, only CSS and JavaScript bundling is supported. To use this provider for bundling, have the following line in your configuration:

<setting name="ak.commons.web.bundling.provider" type="System.String" value="Microsoft" />
Web SSO: DotNetOpenAuth (OpenId/Google)
The library is available in Nuget as AK.Commons.Providers.Web.Security.OpenId. You can use the Package Manager Console in Visual Studio and run Install-Package AK.Commons.Providers.Web.Security.OpenId.

This uses DotNetOpenAuth for OpenId based web SSO. Currently, only Google is supported as an identity provider. To use the Google provider, have the following line in your configuration:

<setting name="ak.commons.web.security.webauth.provider" type="System.String" value="Google" />

If, for some reason, you need to change the request URL for Google, you can set the configuration key ak.commons.providers.web.security.openid.googleRequestUrl to the value you want. By default, this is set to https://www.google.com/accounts/o8/id.