View CollectionExtensions.cs
// 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
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
// 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
// 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
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
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
{ | |
"query":"mutation AddToCartMutation($input: AddToCartInput!) { | |
addToCart(input: $input) { | |
cart { | |
total { | |
amount | |
currencyCode | |
formattedAmount | |
} | |
} |
View GoogleFeedMapping.xml
<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
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
[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