Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need Help please,
how to connect dockerized api (model.cs with scaffolded controller using asp.net core 3.1 and ef core) with sql server 2019 container? the problem is when i add docker compose support using the tool i dont know how to describe the related docker container for sql server.
Could anyone help me with this please?
Thank You So much in advanced

What I have tried:

i just opened the api project template in VisualStudio 2019
and deleted the default Temperature model and the Temperature default controller 
then created new folder named models
and inside it new model.cs 
then scaffolded an API controller with actions
then made the right adjustment to connect it with the sql server container 
then i containerized the API it self 
then then added docker compose 
then the tool in VS19 will see only the web API service
i need to add SQL server Infos in the docker compose .yaml file and connect the two containers but i tried everything and nothing works!!
i was able to connect the api to the sql server container when the api was not dockerized using just the right connection string in appsettings.json but i need to do it while each has a container
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900