I'm new to Web Api creation I'm trying to create a Web Api for an app which isn't designed very well (web api is in Asp.Net framework 4.5).
The current App is in .Net framework 4.5, c# / vb.net and is currently accessed through winforms UI or console It requires services to be started which are static (as in the classes) and depend on a connection string to a sql server (also static). There's more static/ shared code in the app.
These services take too long to start so once the user is logged in, The service should remain persistant for that login until he logs out. (each user gets his own service)
When the user logs in they are able to specify a database name & server they wish to connect to. And it'll show the data on that database (same schema, different data on the databases)
The app was designed to be just used on desktop, after an .exe click. It works fine where a single user hits the .exe and he enters a his log in credentials.
The web Api and App will be on same server/machine (unless it's a bad idea)
current structure of project
CompanyName.Product.Project1
CompanyName.Product.Project2
CompanyName.Product.Project3
......
...... (50 more projects)
CompanyName.Product.WebApi
How do i solve this issue of static code in the app which will effectively override when a new user logs in or am i missing a trick in Web Api config I can only think of launching the app for each login/ user (so multiple apps running for each login) and some how call the methods which i need to return data. Once the user logs out i kill the app for that user.