Skip to content

Instantly share code, notes, and snippets.

Chris Auer dnstommy

Block or report user

Report or block dnstommy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Avatar.cs
public async Task<bool> SetContactAvatar(string source, string identifier, MediaItem mediaItem)
{
using (XConnectClient client = SitecoreXConnectClientConfiguration.GetClient())
{
try
{
var reference = new IdentifiedContactReference(source, identifier);
var contact = client.GetAsync(
reference,
View MemberInfo.cshtml
@model Sitecore.Foundation.MembershipXdb.Models.MemberInfoModel
@if (Model.MemberDataIsNull || Model.PersonalInfoIsNull)
{
<div class="row">
<div class="col-lg-6">
<div class="sc-advancedExpander-header data-sc-registered" data-bind="click: toggle">
<table>
<tbody>
<tr>
View EpExpressModel.cs
namespace Sitecore.Foundation.MembershipXdb.Models
{
using Sitecore.XConnect.Collection.Model;
public class MemberInfoModel
{
public string ContactId { get; set; }
public int VisitCount { get; set; }
public MembershipFacet MemberData { get; set; }
public PersonalInformation PersonalInfo { get; set; }
View EpExpressViewModel.cs
namespace Sitecore.Foundation.MembershipXdb.Experience.Tabs
{
using System;
using EPExpressTab.Data;
using EPExpressTab.Repositories;
using Sitecore.XConnect.Collection.Model;
//TODO Sitecore9
public class MemberView : EpExpressViewModel
{
View showconfig.aspx
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="Sitecore.Configuration" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Xml" %>
<%
XmlDocument configuration = Factory.GetConfiguration();
Response.ContentType = "application/xml";
Response.Write(configuration.OuterXml);
View SitecoreMvc.xml
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.3" />
<PackageReference Include="Microsoft.AspNet.Razor" Version="3.2.3" />
<PackageReference Include="Microsoft.AspNet.WebPages" Version="3.2.3" />
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="1.0.3" />
<PackageReference Include="Microsoft.Net.Compilers" Version="1.3.2" />
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0.0" />
<PackageReference Include="Sitecore.Kernel.NoReferences" Version="9.0.180604" />
<PackageReference Include="Sitecore.Logging.NoReferences" Version="9.0.180604" />
<PackageReference Include="Sitecore.Mvc.NoReferences" Version="9.0.180604" />
View Assign Profile.cs
/// <summary>Defines the run class.</summary>
/// <typeparam name="T">The rule context.</typeparam>
public class ApplyProfileValue<T> : RuleAction<T> where T : RuleContext
{
/// <summary>Gets or sets the script id.</summary>
/// <value>The script id.</value>
public string Profilecardkey { get; set; }
/// <summary>Executes the specified rule context.</summary>
View Rules Macro.cs
public class ProfileCardMacro : IRuleMacro
{
public void Execute(XElement element, string name, UrlString parameters, string value)
{
Assert.ArgumentNotNull((object)element, "element");
Assert.ArgumentNotNull((object)name, "name");
Assert.ArgumentNotNull((object)parameters, "parameters");
Assert.ArgumentNotNull((object)value, "value");
var selectItemOptions = new SelectItemOptions();
View nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="sitecore" value="https://sitecore.myget.org/F/sc-packages/api/v3/index.json" />
</packageSources>
</configuration>
View BonfireAppender.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<log4net>
<appender name="RavenAppender" type="Bonfire.LogAppender.CustomAppender, Bonfire.LogAppender">
<file value="$(dataFolder)/logs/log.{date}.txt" />
<DSN value="https://XXXXXXXXX:XXXXXXXXX@sentry.io/200766" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%4t %d{ABSOLUTE} %-5p %m%n" />
</layout>
You can’t perform that action at this time.