feat: migrate 26eac54 state to Matrix42 26.1

This commit is contained in:
Meik
2026-06-30 13:26:07 +02:00
parent 26eac54f94
commit 063098808f
772 changed files with 13228 additions and 2637 deletions

View File

@@ -0,0 +1,20 @@
using Matrix42.Extensions.Scaffolder.Core.Project;
using System.Collections.Generic;
namespace Matrix42.Extensions.Scaffolder.Core.Functionality
{
public interface IProjectFunctionalityDefinition
{
ProjectFunctionality Kind { get; }
/// <summary>
/// Files to create for this functionality (relative paths, template content).
/// </summary>
IEnumerable<TemplateFile> GetFiles(ExtensionScaffoldingOptions options, ProjectDefinition project);
/// <summary>
/// References to add to the csproj.
/// </summary>
IEnumerable<ProjectReferenceDefinition> GetReferences(ExtensionScaffoldingOptions options, ProjectDefinition project);
}
}

View File

@@ -0,0 +1,65 @@
using Matrix42.Extensions.Scaffolder.Core.Project;
using System.Collections.Generic;
namespace Matrix42.Extensions.Scaffolder.Core.Functionality
{
public sealed class WebApiFunctionalityDefinition : IProjectFunctionalityDefinition
{
public ProjectFunctionality Kind => ProjectFunctionality.WebApi;
public IEnumerable<TemplateFile> GetFiles(
ExtensionScaffoldingOptions options,
ProjectDefinition project)
{
var ns = options.ExtensionNamespace;
yield return new TemplateFile
{
RelativePath = @"Controllers\TestController.cs",
Content = WebApi_TestControllerTemplate.Replace("{ns}", ns),
CreateIfMissingOnly = true
};
}
public IEnumerable<ProjectReferenceDefinition> GetReferences(ExtensionScaffoldingOptions options, ProjectDefinition project)
{
yield return new ProjectReferenceDefinition
{
Include = "Matrix42.WebApi.Contracts",
HintPath = @"..\..\..\..\Root\bin\Matrix42.WebApi.Contracts.dll"
};
yield return new ProjectReferenceDefinition
{
Include = "Matrix42.Hosting.Contracts",
HintPath = @"..\..\..\..\Root\bin\Matrix42.Hosting.Contracts.dll"
};
}
private const string WebApi_TestControllerTemplate =
@"
using Matrix42.WebApi.Contracts;
using Matrix42.Hosting.Contracts;
namespace {ns}.Services
{
[RoutePrefix(""api/test"")]
public class TestController : ApiController
{
private readonly IDependencyResolver _resolver;
public TestController(IDependencyResolver resolver)
{
_resolver = resolver;
}
[HttpPost, Route(""test"")]
public string TestMethod()
{
// TODO: implement your test method logic
return ""OK"";
}
}
}";
}
}