public static void Mail(this Maker maker, string @in, string name) { var input = new { Name = name, In = maker.Namespace(@in), }; maker.Template("Mailable", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}Mail.cs"); maker.Template("MailTemplate", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}Mail.cshtml"); }
public static void Job(this Maker maker, string @in, string name, string action) { var input = new { Name = name, In = maker.Namespace(@in), Action = action }; maker.Template("Job", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}{action}.cs"); maker.Template("JobTest", input, maker.Solution.AppTestsDir / "Features" / @in / $"{name}{action}Test.cs"); }
public static void Query(this Maker maker, string @in, string name, string action) { var input = new { Name = name, In = maker.Namespace(@in), Action = action }; maker.Template("Query", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}{action}.cs"); maker.Template("Query.cshtml", input, maker.Solution.FeaturesDir / @in / $"{action}.cshtml"); maker.Template("QueryTest", input, maker.Solution.AppTestsDir / "Features" / @in / $"{name}{action}Test.cs"); maker.Template("QueryPageTest", input, maker.Solution.AppPageTestsDir / "Pages" / @in / $"{name}{action}PageTest.cs"); }
public static void Command(this Maker maker, string @in, string name, string action) { var input = new { Name = name, In = maker.Namespace(@in), UrlIn = maker.Url(@in), Action = action }; maker.Template("Command", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}{action}.cs"); maker.Template("Command.cshtml", input, maker.Solution.FeaturesDir / @in / $"{action}.cshtml"); maker.Template("_Command.turbo.cshtml", input, maker.Solution.FeaturesDir / @in / $"_{action}.turbo.cshtml"); maker.Template("CommandTest", input, maker.Solution.AppTestsDir / "Features" / @in / $"{name}{action}Test.cs"); maker.Template("CommandPageTest", input, maker.Solution.AppPageTestsDir / "Pages" / @in / $"{name}{action}PageTest.cs"); }
public static void Feature(this Maker maker, string @in, string name, string action, string template) { var input = new { Name = name, In = maker.Namespace(@in), Action = action }; maker.Template($"{template}-Feature", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}{action}.cs"); maker.Template($"{template}-Feature.cshtml", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{action}.cshtml"); if (template.Equals("New") || template.Equals("Edit")) { maker.Template($"{template}-_Feature.js.cshtml", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"_{action}.js.cshtml"); } maker.Template($"{template}-FeatureTest", input, maker.Solution.AppTestsDir / "Features" / maker.Expand(@in) / $"{name}{action}Test.cs"); maker.Template($"{template}-FeaturePageTest", input, maker.Solution.AppPageTestsDir / "Pages" / maker.Expand(@in) / $"{name}{action}PageTest.cs"); }
public static void Feature( this Maker maker, string @in, string name, string action, string template, bool withTurboResult = true, bool withView = true, bool withFeatureTest = true, bool withPageTest = true) { var input = new { Name = name, In = maker.Namespace(@in), Action = action }; maker.Template($"{template}-Feature", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{name}{action}.cs"); if (withView) { maker.Template($"{template}-Feature.cshtml", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"{action}.cshtml"); } if (withTurboResult && (template.EndsWith("New") || template.EndsWith("Edit"))) { maker.Template($"{template}-_Feature.turbo.cshtml", input, maker.Solution.FeaturesDir / maker.Expand(@in) / $"_{action}.turbo.cshtml"); } if (withFeatureTest) { maker.Template($"{template}-FeatureTest", input, maker.Solution.AppTestsDir / "Features" / maker.Expand(@in) / $"{name}{action}Test.cs"); } if (withPageTest) { maker.Template($"{template}-FeaturePageTest", input, maker.Solution.AppPageTestsDir / "Pages" / maker.Expand(@in) / $"{name}{action}PageTest.cs"); } }