diff --git a/docker-compose.yml b/docker-compose.yml index 0e662d94e..c9d68f204 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,8 +26,6 @@ services: image: eshop/ordering.api environment: - ConnectionString=TBD - expose: - - "80" ports: - "81:80" extra_hosts: diff --git a/src/Console/eShopConsole/Program.cs b/src/Console/eShopConsole/Program.cs index 612ade529..7a97661a0 100644 --- a/src/Console/eShopConsole/Program.cs +++ b/src/Console/eShopConsole/Program.cs @@ -62,19 +62,9 @@ namespace eShopConsole .Include(o => o.ShippingAddress) .Include(o => o.BillingAddress) .ToList(); - //Could be using .Load() if you don't want to create a List - - //OTHER SAMPLE - //var company = context.Companies - // .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Car) - // .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Country) - // .FirstOrDefault(co => co.companyID == companyID); - - //Assert when running test with a clean In-Memory DB - //Assert.Equal(1, context.Orders.Count()); string cityName = orders.First().ShippingAddress.City; - Console.WriteLine(cityName); + Console.WriteLine("City name retreived from SQL Server: "+cityName); } } } diff --git a/src/Services/Ordering/Ordering.API/.vscode/launch.json b/src/Services/Ordering/Ordering.API/.vscode/launch.json new file mode 100644 index 000000000..b311e1323 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/.vscode/launch.json @@ -0,0 +1,41 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\Ordering.API.dll", + "args": [], + "cwd": "${workspaceRoot}", + "stopAtEntry": false, + "launchBrowser": { + "enabled": true, + "args": "${auto-detect-url}", + "windows": { + "command": "cmd.exe", + "args": "/C start ${auto-detect-url}" + }, + "osx": { + "command": "open" + }, + "linux": { + "command": "xdg-open" + } + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceRoot}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command.pickProcess}" + } + ] +} \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/.vscode/tasks.json b/src/Services/Ordering/Ordering.API/.vscode/tasks.json new file mode 100644 index 000000000..9cd37c150 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/.vscode/tasks.json @@ -0,0 +1,16 @@ +{ + "version": "0.1.0", + "command": "dotnet", + "isShellCommand": true, + "args": [], + "tasks": [ + { + "taskName": "build", + "args": [ + "${workspaceRoot}\\project.json" + ], + "isBuildCommand": true, + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Controllers/ValuesController.cs b/src/Services/Ordering/Ordering.API/Controllers/ValuesController.cs deleted file mode 100644 index 3ddc0705b..000000000 --- a/src/Services/Ordering/Ordering.API/Controllers/ValuesController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers -{ - [Route("api/[controller]")] - public class ValuesController : Controller - { - // GET api/values - [HttpGet] - public IEnumerable Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public string Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody]string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody]string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/src/Services/Ordering/Ordering.API/Dockerfile b/src/Services/Ordering/Ordering.API/Dockerfile index 95f6db16f..b331438fb 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile +++ b/src/Services/Ordering/Ordering.API/Dockerfile @@ -2,6 +2,8 @@ # Other .NET images # FROM microsoft/dotnet:1.0.0-preview2-sdk # FROM microsoft/dotnet:1.0.0-core +# FROM microsoft/aspnetcore +# FROM microsoft/dotnet:1.0.0-preview2-windowsservercore-sdk WORKDIR /app EXPOSE 80 diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index 93063eca1..b009213a3 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -17,6 +17,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup() + //.UseUrls("http://localhost:5555") //Just for KESTREL .Build(); host.Run(); diff --git a/src/Services/Ordering/Ordering.API/project.json b/src/Services/Ordering/Ordering.API/project.json index 822a647aa..c330c3657 100644 --- a/src/Services/Ordering/Ordering.API/project.json +++ b/src/Services/Ordering/Ordering.API/project.json @@ -17,10 +17,10 @@ "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0", "Microsoft.EntityFrameworkCore": "1.0.0", "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0", - "Ordering.Domain": "1.0.0-*", - "Ordering.SqlData": "1.0.0-*", "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", - "Microsoft.AspNetCore.Diagnostics": "1.0.0" + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Ordering.Domain": "1.0.0-*", + "Ordering.SqlData": "1.0.0-*" }, "tools": { "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",