3

Context

As a backend developer, I often have to develop new REST APIs. Because I do know approximately how much time I am going to need to do so, my estimations are often used as a base to define the final price to be proposed to the client. So far so good.

However, I am experiencing more and more remarks from the commercials, asking about being able to sell .NET Core APIs at a lower price. I usually hear something like : why can't you produce something as cheap as a scaffolded backbone REST API ?, etc.

Even if this kind of question is obviously asked from a commercial point of view, I like the idea to be more competitive using my favorite technology.

Question

I would like to know from experienced developer what are your favorite tools and/or technics when you want to speed up your REST API's developement using scaffolders ?

I would like to know :

  • Did you spend more time to configure the scaffolder than the time you won
  • Did you spend more time to erase useless code than the time you won
  • Can some scaffolders respect DDD style, automatically or with minimal setup
  • Is it going to generate code I am going to hate to work with

To summarize : Do you thing you won more time using that kind of technics, or do you think it is just a pain in the ass and I should keep coding it by myself ?

Remark

I already dug a bit into aspnet/Scaffolding but I am more interested in generating REST API's controllers than Razor view's controllers.

piet.t
  • 11,718
  • 21
  • 43
  • 52
Skrface
  • 1,388
  • 1
  • 12
  • 20
  • 1
    I really like Magic (https://github.com/polterguy/magic), it's extremely simple to set up and scaffold new objects with. It's free to use for dev, but there's a small cost for a license to use it in production. (please feel free to delete the next sentence) I have an interview with it's creator ready for release on my podcast - The .NET Core Podcast - in the next month. – Jamie Taylor Apr 30 '19 at 08:10

1 Answers1

0

In the latest version of Visual Studio 2022, there is the possibility to scaffold REST API calls based on defined models and create an MSSQL local database without manually creating migrations and typing commands for adding and updating the database.

Create an API project using the latest .NET version and the default settings. Then, create a Models folder that contains only one entity.

When the model is successfully created, the scaffolding technique can create CRUD actions (endpoints).

During scaffolding, required NuGets are added to the solution, and after scaffolding is done, there will be {your-entity-name}Endpoints.cs, where API calls are located, and in the Data folder FastMinimalAPIContext.cs will be located. Also, in Program.cs, Entity framework configuration will be added automatically.

Majid Shahabfar
  • 4,010
  • 2
  • 28
  • 36