View CollectionExtensions.cs
This file contains 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
// Copyright 2019 Stefan Holm Olsen | |
// | |
// Permission to use, copy, modify, and/or distribute this software for an | |
// purpose with or without fee is hereby granted, provided that the above | |
// copyright notice and this permission notice appear in all copies. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
View Startup.cs
This file contains 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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.Net.Http.Headers; | |
public class Startup | |
{ | |
public void Configure(IApplicationBuilder app) | |
{ | |
var staticFileOptions = new StaticFileOptions | |
{ | |
OnPrepareResponse = context => |
View ArabicGlyphConverter.cs
This file contains 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
// Copyright 2019 Stefan Holm Olsen | |
// | |
// Permission to use, copy, modify, and/or distribute this software for an | |
// purpose with or without fee is hereby granted, provided that the above | |
// copyright notice and this permission notice appear in all copies. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
View ConnectorStateData.cs
This file contains 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
// Copyright 2019 Stefan Holm Olsen | |
// | |
// Permission to use, copy, modify, and/or distribute this software for an | |
// purpose with or without fee is hereby granted, provided that the above | |
// copyright notice and this permission notice appear in all copies. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
View DummyEntityListener.cs
This file contains 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 DummyEntityListener : IEntityListener | |
{ | |
private LoggingScope _loggingScope; | |
public inRiverContext Context { get; set; } | |
public Dictionary<string, string> DefaultSettings => new Dictionary<string, string> | |
{ | |
{ SettingsConstants.DisableTelemetry, "TRUE" }, | |
{ SettingsConstants.InstrumentationKey, "REPLACE ME" } | |
}; |
View SendGridMailService.cs
This file contains 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
using System.Threading.Tasks; | |
using SendGrid; | |
using SendGrid.Helpers.Mail; | |
namespace EPiServer.Reference.Commerce.Site.Features.Mail.Services | |
{ | |
public class SendGridMailService : ITemplateMailService | |
{ | |
private readonly ISendGridSettings _settings; | |
private readonly ISendGridClient _sendGridClient; |
View AddToCart_request.json
This file contains 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
{ | |
"query":"mutation AddToCartMutation($input: AddToCartInput!) { | |
addToCart(input: $input) { | |
cart { | |
total { | |
amount | |
currencyCode | |
formattedAmount | |
} | |
} |
View GoogleFeedMapping.xml
This file contains 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
<FieldMapping xmlns="http://stefanolsen.com/CatalogFeed.GoogleMerchant/MappingDocument.xsd"> | |
<ContentType CommerceType="CatalogNode"> | |
<Fields> | |
<MappedField MetaField="GoogleProductCategoryId" FeedField="google_product_category"/> | |
</Fields> | |
</ContentType> | |
<ContentType CommerceType="Product"> | |
<Fields> | |
<MappedField MetaField="DisplayName" FeedField="title"/> |
View EnsureAjaxLanguageMvcAttribute.cs
This file contains 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 EnsureAjaxLanguageMvcAttribute : ActionFilterAttribute | |
{ | |
private readonly Injected<Settings> _settings; | |
private readonly Injected<IUpdateCurrentLanguage> _updateCurrentLanguage; | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
if (_settings.Service.PageUseBrowserLanguagePreferences) | |
{ | |
// If the PageUseBrowserLanguagePreferences setting is true, this is already handled everywhere. |
View HandleErrorFriendlyAttribute.cs
This file contains 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
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] | |
public sealed class HandleErrorFriendlyAttribute : HandleErrorAttribute | |
{ | |
internal Injected<LocalizationService> LocalizationService; | |
internal Injected<IPageRouteHelper> PageRouteHelper; | |
internal Injected<PageViewContextFactory> PageViewContextFactory; | |
internal Injected<PermissionService> PermissionService; | |
public string ErrorMessageTranslationKey { get; set; } |
NewerOlder