diff --git a/src/Umbraco.Core/Configuration/InfrastructureSettings/Infrastructure.cs b/src/Umbraco.Core/Configuration/InfrastructureSettings/Infrastructure.cs
new file mode 100644
index 0000000000..8a8f4454bc
--- /dev/null
+++ b/src/Umbraco.Core/Configuration/InfrastructureSettings/Infrastructure.cs
@@ -0,0 +1,190 @@
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.InfrastructureSettings
+{
+ public class Infrastructure : ConfigurationSection
+ {
+ private const string InfrastructureSectionName = "umbraco/infrastructure";
+
+ public static Infrastructure Instance
+ {
+ get { return (Infrastructure) ConfigurationManager.GetSection(InfrastructureSectionName); }
+ }
+
+ #region RepositoriesSection Property
+
+ internal const string RepositoriesPropertyName = "repositories";
+
+ [ConfigurationProperty(RepositoriesPropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false)]
+ public Repositories Repositories
+ {
+ get { return ((Repositories)base[RepositoriesPropertyName]); }
+ set { base[RepositoriesPropertyName] = value; }
+ }
+
+ #endregion
+
+ #region PublishingStrategy Property
+
+ internal const string PublishingStrategyPropertyName = "publishingStrategy";
+
+ [ConfigurationProperty(PublishingStrategyPropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false)]
+ public PublishingProvider PublishingStrategy
+ {
+ get { return ((PublishingProvider)base[PublishingStrategyPropertyName]); }
+ set { base[PublishingStrategyPropertyName] = value; }
+ }
+
+ #endregion
+ }
+
+ public class Repositories : ConfigurationElement
+ {
+ [ConfigurationProperty("", IsDefaultCollection = true, IsRequired = true)]
+ public RepositoryElementCollection Repository
+ {
+ get { return ((RepositoryElementCollection)(base[""])); }
+ }
+ }
+
+ [ConfigurationCollection(typeof(Repository), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate, AddItemName = RepositoryPropertyName)]
+ public class RepositoryElementCollection : ConfigurationElementCollection
+ {
+ internal const string RepositoryPropertyName = "repository";
+
+ public override ConfigurationElementCollectionType CollectionType
+ {
+ get
+ {
+ return ConfigurationElementCollectionType.BasicMapAlternate;
+ }
+ }
+
+ protected override string ElementName
+ {
+ get
+ {
+ return RepositoryPropertyName;
+ }
+ }
+
+ protected override bool IsElementName(string elementName)
+ {
+ return elementName == RepositoryPropertyName;
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((Repository)element).InterfaceShortTypeName;
+ }
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new Repository();
+ }
+
+ #region Indexer
+
+ public Repository this[int index]
+ {
+ get { return (Repository)base.BaseGet(index); }
+ }
+
+ public Repository this[string interfaceShortTypeName]
+ {
+ get { return (Repository)base.BaseGet(interfaceShortTypeName); }
+ }
+
+ #endregion
+
+ #region Add
+
+ public void Add(Repository repository)
+ {
+ BaseAdd(repository);
+ }
+
+ #endregion
+
+ #region Remove
+
+ public void Remove(Repository repository)
+ {
+ BaseRemove(repository);
+ }
+
+ #endregion
+
+ #region GetItem
+
+ public Repository GetItemAt(int index)
+ {
+ return (Repository)BaseGet(index);
+ }
+
+ public Repository GetItemByKey(string interfaceShortTypeName)
+ {
+ return (Repository)BaseGet(interfaceShortTypeName);
+ }
+
+ #endregion
+
+ public bool ContainsKey(string interfaceShortName)
+ {
+ bool result = false;
+ object[] keys = this.BaseGetAllKeys();
+ foreach (object key in keys)
+ {
+ if ((string)key == interfaceShortName)
+ {
+ result = true;
+ break;
+
+ }
+ }
+ return result;
+ }
+ }
+
+ public class Repository : ConfigurationElement
+ {
+ internal const string InterfaceShortTypeNamePropertyName = "interfaceShortTypeName";
+
+ [ConfigurationPropertyAttribute(InterfaceShortTypeNamePropertyName, IsRequired = true, IsKey = true, IsDefaultCollection = false)]
+ public string InterfaceShortTypeName
+ {
+ get { return (string) base[InterfaceShortTypeNamePropertyName]; }
+ set { base[InterfaceShortTypeNamePropertyName] = value; }
+ }
+
+ internal const string RepositoryFullTypeNamePropertyName = "repositoryFullTypeName";
+
+ [ConfigurationPropertyAttribute(RepositoryFullTypeNamePropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false)]
+ public string RepositoryFullTypeName
+ {
+ get { return (string)base[RepositoryFullTypeNamePropertyName]; }
+ set { base[RepositoryFullTypeNamePropertyName] = value; }
+ }
+
+ internal const string CacheProviderFullTypeNamePropertyName = "cacheProviderFullTypeName";
+
+ [ConfigurationPropertyAttribute(CacheProviderFullTypeNamePropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false)]
+ public string CacheProviderFullTypeName
+ {
+ get { return (string)base[CacheProviderFullTypeNamePropertyName]; }
+ set { base[CacheProviderFullTypeNamePropertyName] = value; }
+ }
+ }
+
+ public class PublishingProvider : ConfigurationElement
+ {
+ internal const string TypePropertyName = "type";
+
+ [ConfigurationPropertyAttribute(TypePropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false)]
+ public string Type
+ {
+ get { return (string)base[TypePropertyName]; }
+ set { base[TypePropertyName] = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Persistence/DatabaseFactory.cs b/src/Umbraco.Core/Persistence/DatabaseFactory.cs
new file mode 100644
index 0000000000..6ce5bd6ac4
--- /dev/null
+++ b/src/Umbraco.Core/Persistence/DatabaseFactory.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Threading;
+using Umbraco.Core.Configuration;
+
+namespace Umbraco.Core.Persistence
+{
+ ///
+ /// Provides access to the PetaPoco database as Singleton, so the database is created once in app lifecycle.
+ /// This is necessary for transactions to work properly
+ ///
+ public sealed class DatabaseFactory
+ {
+ #region Singleton
+
+ private static readonly Database _database = new Database(GlobalSettings.DbDsn);
+ private static readonly Lazy lazy = new Lazy(() => new DatabaseFactory());
+
+ public static DatabaseFactory Current { get { return lazy.Value; } }
+
+ private DatabaseFactory()
+ {
+ }
+
+ #endregion
+
+ ///
+ /// Returns an instance of the PetaPoco database
+ ///
+ public Database Database
+ {
+ get { return _database; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Persistence/Mappers/ModelDtoMapper.cs b/src/Umbraco.Core/Persistence/Mappers/ModelDtoMapper.cs
new file mode 100644
index 0000000000..6f43b8e304
--- /dev/null
+++ b/src/Umbraco.Core/Persistence/Mappers/ModelDtoMapper.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Reflection;
+using Umbraco.Core.Models;
+
+namespace Umbraco.Core.Persistence.Mappers
+{
+ internal class ModelDtoMapper : IMapper
+ {
+ public void GetTableInfo(Type t, TableInfo ti)
+ { }
+
+ public bool MapPropertyToColumn(PropertyInfo pi, ref string columnName, ref bool resultColumn)
+ {
+ if (pi.DeclaringType == typeof(Content) || pi.DeclaringType == typeof(IContent))
+ {
+ switch (pi.Name)
+ {
+ case "Trashed":
+ columnName = "[umbracoNode].[trashed]";
+ return true;
+ case "ParentId":
+ columnName = "[umbracoNode].[parentID]";
+ return true;
+ case "UserId":
+ columnName = "[umbracoNode].[nodeUser]";
+ return true;
+ case "Level":
+ columnName = "[umbracoNode].[level]";
+ return true;
+ case "Path":
+ columnName = "[umbracoNode].[path]";
+ return true;
+ case "SortOrder":
+ columnName = "[umbracoNode].[sortOrder]";
+ return true;
+ case "NodeId":
+ columnName = "[umbracoNode].[id]";
+ return true;
+ case "Published":
+ columnName = "[cmsDocument].[published]";
+ return true;
+ case "Key":
+ columnName = "[umbracoNode].[uniqueID]";
+ return true;
+ case "CreateDate":
+ columnName = "[umbracoNode].[createDate]";
+ return true;
+ case "Name":
+ columnName = "[umbracoNode].[text]";
+ return true;
+ }
+ }
+
+ if (pi.DeclaringType == typeof(ContentType) || pi.DeclaringType == typeof(IContentType))
+ {
+ switch (pi.Name)
+ {
+ case "Alias":
+ columnName = "[cmsContentType].[alias]";
+ return true;
+ case "Icon":
+ columnName = "[cmsContentType].[icon]";
+ return true;
+ case "Thumbnail":
+ columnName = "[cmsContentType].[thumbnail]";
+ return true;
+ case "Description":
+ columnName = "[cmsContentType].[description]";
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ public Func