using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CoreWebAPI1.Models; using BWPMModels; using System.Data; using SecuringWebApiUsingApiKey.Attributes; namespace CoreWebAPI1.Controllers { [Route("api/[controller]")] [ApiController] public class MyScriptController : Controller { // GET: api/ [HttpGet] public List Get() { dbhelper dbh = new dbhelper(); //dbh.Get_Tabledata("Select * from [Beruf]", false, true); List Details = new List(); return dbh.ConvertDataTable(dbh.Get_Tabledata("exec dbo.generate_c_code 1, 'Optionen'", false, true)); } // GET api//5 [HttpGet("{fnkt},{tablename}")] public List Get(int fnkt, string tablename) { dbhelper dbh = new dbhelper(); List Details = new List(); return dbh.ConvertDataTable(dbh.Get_Tabledata("exec dbo.generate_c_code "+fnkt.ToString()+", '"+tablename+"'", false, true)); } } }