Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SaschaHeyer/75f2f0d652307cad162941237d8e637e to your computer and use it in GitHub Desktop.
Save SaschaHeyer/75f2f0d652307cad162941237d8e637e to your computer and use it in GitHub Desktop.
Sitecore.Forms.Mvc.Controllers.FormController.cs
public class FormController : SitecoreController
{
public FormController()
: this((IRepository<FormModel>)
Factory.CreateObject(Sitecore.Forms.Mvc.Constants.FormRepository, true), (IAutoMapper<IFormModel, FormViewModel>)
Factory.CreateObject(Sitecore.Forms.Mvc.Constants.FormAutoMapper, true), (IFormProcessor<FormModel>)
Factory.CreateObject(Sitecore.Forms.Mvc.Constants.FormProcessor, true), DependenciesManager.AnalyticsTracker)
{
}
public FormController(IRepository<FormModel> repository,
IAutoMapper<IFormModel, FormViewModel> mapper,
IFormProcessor<FormModel> processor,
IAnalyticsTracker analyticsTracker)
{
Assert.ArgumentNotNull((object) repository, "repository");
Assert.ArgumentNotNull((object) mapper, "mapper");
Assert.ArgumentNotNull((object) processor, "processor");
Assert.ArgumentNotNull((object) analyticsTracker, "analyticsTracker");
this.FormRepository = repository;
this.Mapper = mapper;
this.FormProcessor = processor;
this.analyticsTracker = analyticsTracker;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment