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.Collections.Specialized; | |
namespace MikeRobbins | |
{ | |
public class GlassHelpers | |
{ | |
public static NameValueCollection CssClass(string cssClass) | |
{ | |
var collection = new System.Collections.Specialized.NameValueCollection { { "class", cssClass } }; |
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 RegisterWebApiRoute | |
{ | |
public void Process(PipelineArgs args) | |
{ | |
var config = GlobalConfiguration.Configuration; | |
config.Routes.MapHttpRoute("DefaultApiRoute", | |
"MikeAPI/{controller}/{action}/{id}", | |
new { id = RouteParameter.Optional }); |
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; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
namespace ItemServiceConsoler | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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 StructureMapDependencyResolver : IDependencyResolver | |
{ | |
private readonly IContainer _container; | |
public StructureMapDependencyResolver(IContainer container) | |
{ | |
if (container == null) | |
{ | |
throw new ArgumentNullException("container"); | |
} |
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
<?xml version="1.0"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<events> | |
<event name="publish:end"> | |
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> | |
<sites hint="list"> | |
<site force="add">websiteName</site> | |
</sites> | |
</handler> |
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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<publishItem> | |
<processor type="MikeRobbins.CMS.Robots.Robots,MikeRobbins.CMS" patch:after="processor[@type='Sitecore.Publishing.Pipelines.PublishItem.MoveItems, Sitecore.Kernel']" > | |
<FileName>robots.txt</FileName> | |
<ConfigTemplateName>Robots txt configuration</ConfigTemplateName> | |
<WebApplicationRoot>C:\inetpub\wwwroot\MikeRobbins8u2\Website</WebApplicationRoot> | |
</processor> | |
</publishItem> |
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 ItemComparer:IEqualityComparer<Item> | |
{ | |
public bool Equals(Item x, Item y) | |
{ | |
return x.ID.Equals(y.ID); | |
} | |
public int GetHashCode(Item obj) | |
{ | |
return obj.ID.GetHashCode(); |
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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<initialize> | |
<processor patch:after="processor[@type='Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc']" type="MikeRobbins.EntityServiceDemo.Pipelines.Initialize.RegisterIoC, MikeRobbins.EntityServiceDemo"/> | |
</initialize> | |
</pipelines> | |
</sitecore> | |
</configuration> |
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
[ServicesController] | |
public class EntityController : EntityService<Entity> | |
{ | |
public EntityController(Sitecore.Services.Core.IRepository<Entity> repository) | |
: base(repository) | |
{ | |
} | |
public EntityController() | |
: this(new EntityRespository()) |
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 IoCRegistry : Registry | |
{ | |
public IoCRegistry() | |
{ | |
For(typeof(IRepository<Entity>)).Use(typeof(MikeRobbins.Repositories.EntityRespository)); | |
} | |
} |