This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[InitializableModule] | |
[ModuleDependency(typeof(CommerceInitialization))] | |
public class ContactGroupRegistrationInitialization : IInitializableModule | |
{ | |
public void Initialize(InitializationEngine context) | |
{ | |
var metaFieldType = DataContext.Current.MetaModel.RegisteredTypes["ContactGroup"]; | |
MetaEnumItem[] existingItems = MetaEnum.GetItems(metaFieldType); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Web.Http.HttpGet] | |
public async Task<IHttpActionResult> Load() | |
{ | |
//Run your language dependent code | |
string date = DateTime.Now.ToString(ContentLanguage.PreferredCulture); | |
return Ok(date); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
// Convention-based routing. | |
config.Routes.MapHttpRoute( | |
name: "ControllersApi", | |
routeTemplate: "{language}/api/{controller}/{action}", | |
defaults: new { } | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FakeView : IView | |
{ | |
public void Render(ViewContext viewContext, TextWriter writer) | |
{ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GadgetApiController : ApiController | |
{ | |
private readonly ITemplateResolver _templateResolver; | |
private readonly IContentRenderer _contentRenderer; | |
private readonly IContentRepository _contentRepository; | |
public GadgetApiController(ITemplateResolver templateResolver, IContentRenderer contentRenderer, IContentRepository contentRepository) | |
{ | |
this._templateResolver = templateResolver; | |
this._contentRenderer = contentRenderer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EPiServerDocumentFilter : IDocumentFilter | |
{ | |
private readonly string[] _assembliesToExclude = new string[] | |
{ | |
"EPiServer.ApplicationModules", | |
"EPiServer.BaseLibrary", | |
"EPiServer.Configuration", | |
"EPiServer.Data.Cache", | |
"EPiServer.Data", | |
"EPiServer", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[InitializableModule] | |
//Has to be early, to control priority of handlers | |
[ModuleDependency(typeof(DataInitialization))] | |
public class DynamicPropertyBestBetInitializationModule : IInitializableModule | |
{ | |
public void Initialize(EPiServer.Framework.Initialization.InitializationEngine context) | |
{ | |
} | |
public void Uninitialize(EPiServer.Framework.Initialization.InitializationEngine context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Best Bet Selector reacting on URLs that matches based on Segment | |
/// </summary> | |
public class DynamicPropertyBestBetSelector : IBestBetSelector, IDynamicData | |
{ | |
/// <summary> | |
/// The Identity.ExternalId of the BestBet in the BestBetRepository, is stored as the IndexId | |
/// This links the indexed item (ElasticSearch) with the best bet in the BestBetRepository | |
/// | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Handler for hooking in to events to register BestBet Selector for rental properties | |
/// </summary> | |
public class DynamicPropertyBestBetHandler | |
{ | |
private static void DeleteFromIndex(Identity id) | |
{ | |
//Delete the BestBet from our index | |
SearchClient.Instance.Delete<ExternalUrlBestBet>(new TermFilter("Id$$string", FieldFilterValue.Create(id.ExternalId.ToString()))); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
... | |
FacebookAuthenticationOptions options = new FacebookAuthenticationOptions(); | |
options.AppId = "xxxxxx"; | |
options.AppSecret = "yyyyy"; |
NewerOlder