mfractor / mfractor-feedback

Found a bug or have a feature request for MFractor? Submit it here!
3 stars 0 forks source link

Create a Scaffolder for ASP.NET API controllers #242

Closed matthewrdev closed 4 years ago

matthewrdev commented 4 years ago

Criteria

Template

Inputs:


using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;

namespace $namespace$
{
    [ApiController, Route("api")]
    public class $name$ : Controller
    {
        [HttpGet, Route("$route$")]
        public IActionResult Get()
        {
            // TODO: Implement 
            return Ok("Success");
        }
    }
}
matthewrdev commented 4 years ago

@ravero Can you comment on this and let me know if this scaffolder and it's template makes sense for everyday use?

ravero commented 4 years ago

A few things I would adjust:

[HttpGet("$route$")]

Suggestion: as I understand the scaffolder as a tool for quickly creating useful files, a would add a few additional templates:

using System.Threading.Tasks;

[HttpGet, Route("$route$")]
public async Task<ActionResult> GetAsync()
{
            // TODO: Implement 
            return Ok("Success");
}
matthewrdev commented 4 years ago

This has been completed and will be available in MFrator v4.2.2