Can I make an API by adding a .NET Core 6 "wrapper" on top of a .NET Framework webforms website?
There is a website written in Webforms .NET Framework 4.5 . Its big. Its complicated. Its been added to and expanded upon over the last decade.
It relies on a mishmash of inline SQL (with an elaborate way of handling where clauses), stored procedures, and uses those to generate System.Data.DataTable, which are then bound to grids, or looped through to get data to be bound to asp:Label or asp:CheckBoxList or something.
The front end .aspx and the back end C# is very tightly coupled. There aren't even many methods that return data like a function would - empty DataTables are passed in by ref and then populated.
The goal is to make an API using .NET Core 6 on the back end and a front end in React or something. (I know MS dropped the use of the word Core, but everyone I talk to still uses it colloquially.)
Someone suggested "Oh it will be easy! Just add a 'wrapper' using .NET Core 6 that will access the existing Webforms code, to create an API."
I'm not sure the best way to do this. Anyone have any suggestions?
So far, people on the dev team have created an API in .NET Core 6 that uses an MVC pattern. Its interacting with the database independently of the Webforms code. Migrating all the various aspects of the Webforms code to this new .NET Core would be time consuming.
Is there a good way to simply have the new .NET Core 6 API access the Webforms stuff?
Posted Mar 9, 2023, 8:41 PM UTC