1 class ControllerGenerator(NamedGeneratorBase
):
2 [Property(Actions
)] _actions
as (string
)
3 [Property(Action
)] _action
as string
8 MkDir(ControllersBasePath
)
9 Process('Controller.cs', "${ControllersBasePath}/${ClassName}Controller.cs")
11 MkDir(ControllersTestsBasePath
)
12 Process('Test.cs', "${ControllersTestsBasePath}/${ClassName}ControllerTest.cs")
14 MkDir("${ViewsBasePath}/layouts")
15 Process("layout.${ViewEngineExtension}", "${ViewsBasePath}/layouts/${FileName}.${ViewEngineExtension}")
20 Process("View.${ViewEngineExtension}", "${ViewsBasePath}/${FileName}/${Action.ToFileName()}.${ViewEngineExtension}")
22 def Usage() as string
:
23 return 'ControllerName [Action1, Action2, ...]'
26 return 'Generates a controller'
30 return ControllersNamespace
34 return ControllersTestsNamespace
38 return ActionExtension
42 return "${ViewsBasePath}/${FileName}"