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 static class UrlExtensions | |
{ | |
private const string FileDateTicksCacheKeyFormat = "FileDateTicks_{0}"; | |
private static long GetFileDateTicks(this UrlHelper urlHelper, string filename) | |
{ | |
var context = urlHelper.RequestContext.HttpContext; | |
string cacheKey = string.Format(FileDateTicksCacheKeyFormat, filename); | |
// Check if we already cached the ticks in the cache. |
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 AccountController : Controller | |
{ | |
public IActionResult Login() | |
{ | |
return View(); | |
} | |
[HttpPost] | |
[ValidateAntiForgeryToken] | |
public async Task<IActionResult> Login(LoginViewModel model) |
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
@model EPiServer.Core.ContentReference | |
@Html.ContentLink(Model, null, Html.LinkAttributes(Model)) |
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; } |
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. |
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"/> |
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 | |
} | |
} |
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; |
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" } | |
}; |
OlderNewer