I'm just trying to bow my head around this concept. I wrote several different web APIs, but they were always used by the site and interacted via JSON. My question is how to structure the implementation when the web API is consumed by the Windows service.
In this case, an existing database already exists, so I want to use the Entity Framework Database First approach.
I am creating a class library project for models and using the Entity Framework to view an existing database and create all the necessary classes.
Then I create a web API project and add my class library with all the models to it. Until this moment, I'm good.
My question is, when I am going to create a Windows service that will interact with the web API, how can I access classes from my class library model project? I know that I could add this project to my Windows service, but this does not seem to be the right approach, because it will bypass the web API pretty much.
I think my question is, do I want to create and pass an Employee object to my web API (so that it can insert it into the database) from my Windows Service, how does a Windows service get an Employee object without adding the Library class for a Windows service project?
jkruer01
source share