Last active
April 3, 2016 18:08
-
-
Save casper-rasmussen/a61d3410d33322d2d6cef656c22b77c7 to your computer and use it in GitHub Desktop.
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
[TemplateDescriptor( | |
Inherited = true, | |
AvailableWithoutTag = true, | |
Default = true, | |
ModelType = typeof(FormBlockType), | |
TemplateTypeCategory = TemplateTypeCategories.MvcPartialController)] | |
public class FormBlockController : BlockController<FormBlockType> | |
{ | |
private readonly IFormViewModelBuilder _viewModelBuilder; | |
public FormBlockController(IFormViewModelBuilder viewModelBuilder) | |
{ | |
this._viewModelBuilder = viewModelBuilder; | |
} | |
public override ActionResult Index(FormBlockType currentContent) | |
{ | |
FormBlockViewModel viewModel = new FormBlockViewModel(); | |
viewModel.Form = this._viewModelBuilder.Build(currentContent.Form, ContentLanguage.PreferredCulture); | |
//Use Partial view | |
return PartialView(viewModel); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment