Skip to content

Instantly share code, notes, and snippets.

View casper-rasmussen's full-sized avatar

Casper Aagaard Rasmussen casper-rasmussen

View GitHub Profile
public interface ITempDataProvider
{
IDictionary<string, object> LoadTempData(ControllerContext controllerContext);
void SaveTempData(ControllerContext controllerContext, IDictionary<string, object> values);
}
/// <summary>
/// Implementation that stores MVC TempData in DDS instead of through session
/// </summary>
class DynamicDataStoreTempDataProvider : ITempDataProvider
{
private readonly ILog _logManager;
public DynamicDataStoreTempDataProvider()
{
this._logManager = LogManager.GetLogger(typeof(DynamicDataStoreTempDataProvider));
[TemplateDescriptor(Inherited = true, TemplateTypeCategory = TemplateTypeCategories.HttpHandler)]
public class MediaDownloadHttpHandler : BlobHttpHandler, IRenderTemplate<DocumentFileMediaType>
{
public new bool IsReusable
{
get { return false; }
}
protected override Blob GetBlob(HttpContextBase context)
{
<?xml version="1.0" encoding="utf-8" ?>
<languages>
<language name="Danish" id="da-DK">
<header>
<mainnavigation>
<placeholders>
<search>Search</search>
</placeholders>
</mainnavigation>
</header>
[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class DependencyResolverInitialization : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Container.Configure(ConfigureContainer);
DependencyResolver.SetResolver(new StructureMapDependencyResolver(context.Container));
}
class ExampleIncludeConvention : IIncludeConvention
{
public void Apply(Fellow.Epi.Localization.Manager.Convention.IConventionManager conventionManager)
{
conventionManager.IncludeArea("header");
conventionManager.IncludeArea("commerce");
conventionManager.IncludeArea("form");
}
}
[InitializableModule]
[ModuleDependency(typeof(EPiServer.Commerce.Initialization.InitializationModule))]
public class CommerceDependencyResolverInitialization : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
//Remove default types
context.Container.Model.EjectAndRemoveTypes((type) => type.Equals(typeof(EntryBuilder)));
context.Container.Model.EjectAndRemoveTypes((type) => type.Equals(typeof(NodeBuilder)));
context.Container.Model.EjectAndRemove<ICatalogPropertyLoader>();
class BaseNodeContentBuilder : NodeBuilder
{
/// <summary>
/// Initializes a new instance of the <see cref="T:EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder"/> class.
///
/// </summary>
/// <param name="catalogContext">The catalog context.</param><param name="metaClassContentFactory">The meta class content factory.</param><param name="catalogPropertyLoader">The catalog property loader.</param><param name="referenceConverter">The reference converter.</param><param name="contentVersionDB">The catalog content Database access.</param>
[DefaultConstructor]
public BaseNodeContentBuilder(ICatalogSystem catalogContext, MetaClassContentFactory metaClassContentFactory, ICatalogPropertyLoader catalogPropertyLoader, ReferenceConverter referenceConverter, CatalogContentVersionDB contentVersionDB)
: base(catalogContext, metaClassContentFactory, catalogPropertyLoader, referenceConverter, contentVersionDB)
class BaseProductContentBuilder : EntryBuilder
{
/// <summary>
/// Initializes a new instance of the <see cref="T:EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder"/> class.
///
/// </summary>
/// <param name="catalogContext">The catalog context.</param><param name="metaClassContentFactory">The meta class content factory.</param><param name="catalogPropertyLoader">The catalog property loader.</param><param name="referenceConverter">The reference converter.</param><param name="contentVersionDB">The catalog content Database access.</param>
[DefaultConstructor]
public BaseProductContentBuilder(ICatalogSystem catalogContext, MetaClassContentFactory metaClassContentFactory, ICatalogPropertyLoader catalogPropertyLoader, ReferenceConverter referenceConverter, CatalogContentVersionDB contentVersionDB)
: base(catalogContext, metaClassContentFactory, catalogPropertyLoader, referenceConverter, contentVersionDB)
class InheritedCatalogPropertyLoader : CatalogPropertyLoader
{
private string[] _localReservedNames = new string[] { "Epi_StartPublish", "Epi_IsPublished", "Epi_StopPublish" };
private readonly MetaDataPropertyConfiguration _metaDataPropertyConfiguration;
private readonly MetaDataPropertyMapper _metaDataPropertyMapper;
/// <summary>
/// Initializes a new instance of the <see cref="T:EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader"/> class.
///