-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding template files, updating readme
- Loading branch information
1 parent
1f5d6c4
commit 27b5e94
Showing
8 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using EPiServer; | ||
using EPiServer.Core; | ||
using EPiServer.Web.Mvc; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.Threading.Tasks; | ||
|
||
namespace {featureNamespace}.{type}.{className} | ||
{ | ||
public class {className}Component : AsyncBlockComponent<{className}> | ||
{ | ||
private readonly IContentLoader _contentLoader; | ||
|
||
public {className}Component(IContentLoader contentLoader) | ||
{ | ||
_contentLoader = contentLoader; | ||
} | ||
|
||
protected override async Task<IViewComponentResult> InvokeComponentAsync({className} currentBlock) | ||
{ | ||
var model = new {className}ViewModel(currentBlock); | ||
return await Task.FromResult(View("~/Features/{type}/{className}/{className}.cshtml", model)); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using {blockVmNamespace}; | ||
|
||
namespace {featureNamespace}.{type}.{className} | ||
{ | ||
public class {className}ViewModel : {blockVmClass}<{className}> | ||
{ | ||
public {className}ViewModel({className} currentBlock) : base(currentBlock) | ||
{ | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@model {featureNamespace}.{type}.{className}.{className}ViewModel |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using EPiServer.Web.Mvc; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace {featureNamespace}.{type}.{className} | ||
{ | ||
public class {className}Controller : PageController<{className}> | ||
{ | ||
public ActionResult Index({className} currentContent) => View(ContentViewModel.Create<{className}>(currentContent)); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using EPiServer.Core; | ||
using EPiServer.DataAbstraction; | ||
using EPiServer.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations; | ||
using {abstractNamespace}; | ||
|
||
namespace {featureNamespace}.{type}.{className} | ||
{ | ||
[ContentType(DisplayName = "{cmsname}", | ||
GUID = "{guid}", | ||
Description = "{cmsname}")] | ||
public class {className} : {abstractClassName} | ||
{ | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using EPiServer.DataAbstraction; | ||
using System.Linq; | ||
using {abstractNamespace}; | ||
using {pageVmNamespace} | ||
|
||
namespace {featureNamespace}.{type}.{className} | ||
{ | ||
public class {className}ViewModel : {pageVmClass}<{className}> | ||
{ | ||
public {className}ViewModel({className} currentPage) : base(currentPage) | ||
{ | ||
} | ||
|
||
public static {className}ViewModel Create({className} currentPage) | ||
{ | ||
var model = new {className}ViewModel(currentPage); | ||
return model; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@model {featureNamespace}.{type}.{className}.{className}ViewModel |
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