Skip to content

Instantly share code, notes, and snippets.

@Azadehkhojandi
Azadehkhojandi / API.cs
Last active January 8, 2016 02:46
create table with GEOGRAPHY column
public class Landmark
{
public string Id { get; set; }
public string Title { get; set; }
public string Latitude { get; set; }
public string Longitude { get; set; }
public string Distance { get; set; }
}
public class LandmarkController : ApiController
{
@Azadehkhojandi
Azadehkhojandi / Implements
Created October 12, 2015 05:17
check sitecore implements a template
public static bool Implements(this Item item, params ID[] templateIds)
{
if (templateIds.Length == 0)
{
throw new ArgumentOutOfRangeException("templateIds", "must include at least one template");
}
if (item == null || item.Template == null)
{
return false;
}
@Azadehkhojandi
Azadehkhojandi / MultiRootEditFrameChromeData.cs
Created July 28, 2015 02:43
sitecore custom edit frame buttons
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Fields;
using Sitecore.Data.Items;