Files
Umbraco-CMS/src/Umbraco.Core/Runtime/CoreRuntimeComponent.cs

29 lines
1.0 KiB
C#
Raw Normal View History

2019-01-03 21:00:28 +01:00
using System.Collections.Generic;
using AutoMapper;
using Umbraco.Core.Components;
using Umbraco.Core.IO;
2017-12-28 09:27:57 +01:00
namespace Umbraco.Core.Runtime
{
2019-01-03 21:00:28 +01:00
public class CoreRuntimeComponent : IComponent
{
2019-01-03 21:00:28 +01:00
internal CoreRuntimeComponent(IEnumerable<Profile> mapperProfiles)
{
2017-07-19 13:42:47 +02:00
// mapper profiles have been registered & are created by the container
Mapper.Initialize(configuration =>
{
2017-07-19 13:42:47 +02:00
foreach (var profile in mapperProfiles)
configuration.AddProfile(profile);
});
2016-09-08 18:43:58 +02:00
// ensure we have some essential directories
// every other component can then initialize safely
IOHelper.EnsurePathExists("~/App_Data");
IOHelper.EnsurePathExists(SystemDirectories.Media);
IOHelper.EnsurePathExists(SystemDirectories.MvcViews);
IOHelper.EnsurePathExists(SystemDirectories.MvcViews + "/Partials");
IOHelper.EnsurePathExists(SystemDirectories.MvcViews + "/MacroPartials");
}
}
}