Skip to content

Instantly share code, notes, and snippets.

@khurramkhang
khurramkhang / AddonValidation.cs
Created December 21, 2016 10:46
Custom Line Item Validator
using System;
using System.Linq;
using EPiServer;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Commerce.Order;
using EPiServer.Commerce.Validation;
using Mediachase.Commerce;
using Mediachase.Commerce.Catalog;
using Mediachase.Commerce.Catalog.Dto;
@khurramkhang
khurramkhang / CustomPlacedPriceProcessor.cs
Created December 21, 2016 15:56
Custom Placed Price Price Processor
using System;
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Commerce.Order;
using Mediachase.Commerce;
using Mediachase.Commerce.Customers;
using Mediachase.Commerce.Catalog;
using Mediachase.Commerce.Pricing;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.Text;
using System.Web;
using System.Web.Mvc;
using EPiServer;
@khurramkhang
khurramkhang / ISerializeContents.cs
Created July 20, 2017 09:48
Serialize EPiServer IContent
using System.Dynamic;
using EPiServer.Core;
namespace PixieDigital.EpiServer.Extensions.Contents
{
public interface ISerializeContents
{
ExpandoObject SerializeableContent(IContent content);
ExpandoObject SerializeableContent(ContentReference contentReference);
}
@khurramkhang
khurramkhang / SqlPasswordHasher.cs
Last active October 31, 2017 15:12
Migrate to ASP.Net Identity
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Microsoft.AspNet.Identity;
namespace MySite.Business.Identity
{
public class SqlPasswordHasher : PasswordHasher
@khurramkhang
khurramkhang / ApplicationBuilderExtensions.cs
Last active November 22, 2017 09:40
App builder extensions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EPiServer.Cms.UI.AspNetIdentity;
using EPiServer.Shell.Security;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
@khurramkhang
khurramkhang / SpecialCharactersInUrlModule.cs
Created December 5, 2017 15:39
Add special characters in URL
//Tested in EPiServer CMS 11
using System;
using System.Configuration;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using EPiServer.Web;
namespace Alloy.Business
{
@khurramkhang
khurramkhang / EpiFormextension
Created December 11, 2018 08:07
Get Specific Epi Server Form Elements
using EPiServer.Core;
using EPiServer.Forms.Core;
using EPiServer.Forms.Core.Models;
using EPiServer.Forms.Helpers.Internal;
using EPiServer.Forms.Implementation.Elements;
using System.Collections.Generic;
using System.Linq;
namespace PixieDigital.EpiServer.Extensions
{
using System;
using System.Collections.Generic;
using System.Linq;
using CommerceExtensions.Order;
using Mediachase.Commerce;
using Mediachase.Commerce.Catalog;
using Mediachase.Commerce.Pricing;
namespace CommerceExtensions.Pricing
{
@khurramkhang
khurramkhang / MigrateToAsp.NetIdentity
Last active December 18, 2023 12:32
Migrate Users to ASP.Net Identity
select * from [dbo].[Users]
INSERT INTO AspNetUsers(Id,
UserName,
Email,
PasswordHash,
SecurityStamp,
EmailConfirmed,
PhoneNumber,
PhoneNumberConfirmed,