This file contains hidden or 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:x="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<databases> | |
<database id="web" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel"> | |
<Engines.HistoryEngine.Storage> | |
<obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel"> | |
<param connectionStringName="$(id)" /> | |
<EntryLifeTime>30.00:00:00</EntryLifeTime> | |
</obj> | |
</Engines.HistoryEngine.Storage> |
This file contains hidden or 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 NavigationItem : SitecoreItem | |
{ | |
} | |
[SitecoreType] | |
public class NavigationFolder : SitecoreItem | |
{ | |
[SitecoreField("Main Menu")] | |
public virtual IEnumerable<NavigationItem> MainMenu { get; set; } | |
} |
This file contains hidden or 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 GlassMapperScCustom | |
{ | |
public static void CastleConfig(IWindsorContainer container) | |
{ | |
var config = new Config(); | |
container.Install(new SitecoreInstaller(config)); | |
container.Register( | |
Component.For<ISitecoreContext>().ImplementedBy<SitecoreContext>().LifestyleTransient(), |
This file contains hidden or 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 TheDeployment : Deployment<TheDeployment, DeploymentSettings> | |
{ | |
public TheDeployment() | |
{ | |
Define(settings => DeploymentStepsFor(SitecoreInstallation, s => | |
{ | |
s.UnzipArchive(settings.SitecoreArchivePath).To(settings.SitecoreExtractPath).DeleteDestinationBeforeDeploying(); | |
s.CopyDirectory(settings.SitecoreExtractPath + @"Sitecore 6.6.0 rev. 130404\Website\").To(settings.WebsitePath).ClearDestinationBeforeDeploying(); |
This file contains hidden or 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
var car = new Car | |
{ | |
Make = "Toyota", | |
AWD = true | |
}; | |
TempData.Put("Automobile", car); | |
TempData.Get<Motorcycle>("Automobile") |
This file contains hidden or 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 TempDataExtension | |
{ | |
public static void Put(this TempDataDictionary tempData, string key, object value) | |
{ | |
var js = new JavaScriptSerializer(); | |
tempData[key] = js.Serialize(value); | |
} | |
public static T Get<T>(this TempDataDictionary tempData, string key) where T : class | |
{ |
This file contains hidden or 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 abstract class CreateCommandHandler<TCommand> : CommandHandler<TCommand> where TCommand : ICommand | |
{ | |
public override void Handle(TCommand command) | |
{ | |
var aggregateRoot = CreateAggregateRoot(command); | |
Handle(command, aggregateRoot); | |
var domainRepository = ServiceLocator.Current.Resolve<IDomainRepository>(); | |
This file contains hidden or 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
// Business object living in the Domain layer | |
public class Project : Entity | |
{ | |
public virtual string Name { get; set; } | |
} | |
// Controller | |
public class HomeController : Controller | |
{ |
This file contains hidden or 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
private static void AddApplicationServicesTo(IWindsorContainer container) | |
{ | |
container.Register( | |
AllTypes | |
.FromAssemblyNamed("SharpArchCookbook.Tasks") | |
.Pick() | |
.WithService.FirstInterface()); | |
} | |
private static void AddQueriesTo(IWindsorContainer container) |
This file contains hidden or 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
// #001 Using Query Objects | |
namespace SharpArchCookbook.Web.Mvc.Controllers.Queries.Products | |
{ | |
using Domain; | |
using MvcContrib.Pagination; | |
using NHibernate.Transform; | |
using SharpArch.NHibernate; | |
using ViewModels; |