So at this point, I have two projects in my VS solution:
RecipeAPI, which is a ASP.Net Core Application RecipeUI, which is a Windows Forms Application
Inside the RecipeAPI project, I already have the model and controller classes made and now I have to create a prototype UI in which the functionality should be implemented.
My issue is using the classes and objects from the API project, into the UI one. For example:
I am trying to populate a ListBox. Inside RecipeAPI, I have a controller class named RecipeController, which has the following method for retrieving data from the database:
        [Route("v1/recipe/{recipeBy}")]
    [HttpGet()]
    public List<Recipe> GetRecipes(string recipeBy)
    {
        using (var con = _connFactory())
        {
            con.Open();
            return con.Query<Recipe>("SELECT * FROM dbo.Recipe WHERE RecipeBy = @recipeBy", new { recipeBy }).ToList();
        }
    }
This was tested using PostMan, works perfectly fine. However, I am having huge issues trying to figure out how to populate the ListBox. In fact, I am having issues figuring out how I can use certain methods from a project to another. To be noted that I have already added references.
Moving forward, this is the method in the Forms class which is supposed to populate the ListBox.
    private void ShowRecipes(string recipeBy)
    {
        List<Recipe> recipeList = new List<Recipe>;
        recipeList = GetRecipes(recipeBy);
        recipeListBox.DataSource = recipeList;
    }
I am not entirely sure how correct this is. Basically what I am trying to do is get the list of recipes by calling the method GetRecipes() from RecipeController. Unfortunately, I am getting errors such as:
The type or namespace name 'Recipe' could not be found The name 'GetRecipes' does not exist in the current context
So what am I missing here? Am I even on the right track or I shouldn't even try combining Web Forms and ASP.Core? And if this works too, then how can I be able to access methods from RecipeAPI.Controllers in RecipeUI Form?