Minor changes - Working docker-compose up on Docker Linux
This commit is contained in:
parent
9ede5f0522
commit
b28d37ce97
@ -26,8 +26,6 @@ services:
|
|||||||
image: eshop/ordering.api
|
image: eshop/ordering.api
|
||||||
environment:
|
environment:
|
||||||
- ConnectionString=TBD
|
- ConnectionString=TBD
|
||||||
expose:
|
|
||||||
- "80"
|
|
||||||
ports:
|
ports:
|
||||||
- "81:80"
|
- "81:80"
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
@ -62,19 +62,9 @@ namespace eShopConsole
|
|||||||
.Include(o => o.ShippingAddress)
|
.Include(o => o.ShippingAddress)
|
||||||
.Include(o => o.BillingAddress)
|
.Include(o => o.BillingAddress)
|
||||||
.ToList();
|
.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<Order>().ShippingAddress.City;
|
string cityName = orders.First<Order>().ShippingAddress.City;
|
||||||
Console.WriteLine(cityName);
|
Console.WriteLine("City name retreived from SQL Server: "+cityName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
41
src/Services/Ordering/Ordering.API/.vscode/launch.json
vendored
Normal file
41
src/Services/Ordering/Ordering.API/.vscode/launch.json
vendored
Normal file
@ -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}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
16
src/Services/Ordering/Ordering.API/.vscode/tasks.json
vendored
Normal file
16
src/Services/Ordering/Ordering.API/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"version": "0.1.0",
|
||||||
|
"command": "dotnet",
|
||||||
|
"isShellCommand": true,
|
||||||
|
"args": [],
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"taskName": "build",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}\\project.json"
|
||||||
|
],
|
||||||
|
"isBuildCommand": true,
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -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<string> 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)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,6 +2,8 @@
|
|||||||
# Other .NET images
|
# Other .NET images
|
||||||
# FROM microsoft/dotnet:1.0.0-preview2-sdk
|
# FROM microsoft/dotnet:1.0.0-preview2-sdk
|
||||||
# FROM microsoft/dotnet:1.0.0-core
|
# FROM microsoft/dotnet:1.0.0-core
|
||||||
|
# FROM microsoft/aspnetcore
|
||||||
|
# FROM microsoft/dotnet:1.0.0-preview2-windowsservercore-sdk
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
@ -17,6 +17,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
|
|||||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
.UseIISIntegration()
|
.UseIISIntegration()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
|
//.UseUrls("http://localhost:5555") //Just for KESTREL
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
host.Run();
|
host.Run();
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
|
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
|
||||||
"Microsoft.EntityFrameworkCore": "1.0.0",
|
"Microsoft.EntityFrameworkCore": "1.0.0",
|
||||||
"Microsoft.EntityFrameworkCore.SqlServer.Design": "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.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": {
|
"tools": {
|
||||||
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
|
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user