mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Electron.NET & .Net Core 2.2 Web API #346
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hamendranathtyagi on GitHub (Jun 18, 2019).
Originally assigned to: @GregorBiswanger on GitHub.
How to host and consume .Net Core 2.2 Web API inside Electron.Net ?
@robalexclark commented on GitHub (Jun 21, 2019):
Web API is just a set of controller methods that provide data to the client side (or another client side system). You would not use electron to host just a Web API for other systems to consume.
@hamendranathtyagi commented on GitHub (Jun 21, 2019):
@robalexclark - My current Project has 3 Web API to interact with database. Also My UI has been developed in Angular. Now I am trying to create desktop application using Electron.Net framework and need to host 3 Web API inside electron framework as well. So that my end users can run this project as EXE and host all 3 Web API inside Electron.Net framwork only. Regards
@robalexclark commented on GitHub (Jun 21, 2019):
As long as your web API is in the same project as the client side Angular they should work fine.
For example, if you take a look at the following electron net based repo:
https://github.com/robalexclark/SilveR
Specifically the controllers at:
https://github.com/robalexclark/SilveR/tree/master/SilveR/Controllers
You will see that there are controllers for views (e.g. homecontroller), but there are also web API controllers as well (e.g. ValuesController), that provide methods for the client side javascript to consume
@hamendranathtyagi commented on GitHub (Jun 21, 2019):
@robalexclark - My Web APIs are not in the same project as Angular. These are different 3 Web API projects and 4th one is UI project. Hence I am looking the way to host these 3 web APIs in Electron so that I can consume by Angular UI. Regards
@robalexclark commented on GitHub (Jun 21, 2019):
It might be possible to combine all projects into a single Visual Studio solution with the UI project as the entry point that you apply electron.net to. However I have no idea how you would sort out the routing. Easiest solution would be to copy all the web api methods into a single VS solution though...