I am quite new to C# and .NET and I have started working on a small local application.
In one visual studio solution, I should create a website than can retrieve messages written from a console application and display / store them in a database.
I was mostly wondering if there is any "preferred" way of doing it.
At the time, I have come up with two possible ways of doing it I think.
The first method Console Application CA References Website MVC Application WA which has a model class called Message. (it is simply a message i want to transfer)
When a user inputs text into a command line and hits enter, a new Message is created with that text. From there, I was thinking to use the <% ViewData["Variable"]%> to pass the information. Is this a good way of doing it?
The second method which I has not tested yet: My initial thought was to create a http connection and send a POST request to the website. I briefly read about creating a Web API application that would handle this.
Is there any other "standard" or preferred ways of solving the task?
I am looking for an efficient way of doing it along with testability.
/If anyone ends up here, you can check out the result of this/ https://github.com/egenvall/ConsoleToBrowser