Electron.NET & .Net Core 2.2 Web API #346

Closed
opened 2026-01-29 16:37:01 +00:00 by claunia · 5 comments
Owner

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 ?

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 ?
claunia added the question label 2026-01-29 16:37:01 +00:00
Author
Owner

@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.

@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.
Author
Owner

@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

@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
Author
Owner

@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

@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
Author
Owner

@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

@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
Author
Owner

@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...

@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...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#346