Skip to content

Commit

Permalink
path problem fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasith Jayawardana committed Jun 17, 2018
1 parent 8a28ef6 commit bbf668c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build
bin/
obj/

# IDE
.vscode

# MacOS
.DS_Store

# Generated Data
data.json
2 changes: 1 addition & 1 deletion Controllers/CarController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace coding.Controllers
public class CarController : ControllerBase
{
private readonly CarContext _context;
private string _path = Environment.CurrentDirectory+"\\data.json";
private string _path = Path.Combine(Environment.CurrentDirectory, "data.json");
private void AddCarsToContext(){
_context.Cars.Add(new Car { Manufacturer = "Ford",Make="Mustang",Model="GT",Year=2015 });
_context.Cars.Add(new Car { Manufacturer = "Chevrolet",Make="Corvette",Model="Z06",Year=2017 });
Expand Down

0 comments on commit bbf668c

Please sign in to comment.