DZone

My CTO is a kick ass SQL guy, but he doesn’t know much C#, so wrapping his SQL into a Web API is difficult for him. Every now and then he throws me some SQL statement or Stored Procedure in our Teams chat, and asks me to wrap it into an HTTP endpoint for him, because one of my colleagues needs it for our frontend parts. The process is almost the exact same every single time.

  • Wrap the SQL into an SqlQuery invocation using Entity Framework
  • Create some sort of view model matching the return from the Store Procedure
  • Choose which roles are allowed to access the endpoint
  • Parametrise the SQL invocation
  • Execute the SQL and return the content as my view model

Realising I could completely automate this process using Magic, providing high level UX components doing the entirety of the job, resulted in the following click button solution.

Source: DZone